File tree Expand file tree Collapse file tree 5 files changed +21
-3
lines changed Expand file tree Collapse file tree 5 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
repos :
2
2
- repo : https://github.com/LiquidFun/aoc_tiles
3
- rev : 0.3.3
3
+ rev : 0.3.4
4
4
hooks :
5
5
- id : aoc-tiles
6
6
args :
Original file line number Diff line number Diff line change
1
+ from sys import stdin
2
+
3
+ lines = stdin .read ().strip ().split ('\n ' )
4
+
5
+ first = last = 0
6
+ for line in lines :
7
+ diff = [int (a ) for a in line .split ()]
8
+ sign = 1
9
+ while any (diff ):
10
+ last += diff [- 1 ]
11
+ first += diff [0 ] * sign
12
+ sign *= - 1
13
+ diff = [b - a for a , b in zip (diff , diff [1 :])]
14
+
15
+ print (first , last , sep = '\n ' )
Original file line number Diff line number Diff line change 4
4
5
5
<!-- AOC TILES BEGIN -->
6
6
<h1 align =" center " >
7
- 2023 - 16 ⭐
7
+ 2023 - 18 ⭐
8
8
</h1 >
9
9
<a href =" 2023/01/01.rs " >
10
10
<img src =" .aoc_tiles/tiles/2023/01.png " width =" 161px " >
27
27
<a href =" 2023/07/07.py " >
28
28
<img src =" .aoc_tiles/tiles/2023/07.png " width =" 161px " >
29
29
</a >
30
- <a href =" 2023/08/08.rs " >
30
+ <a href =" 2023/08/08.py " >
31
31
<img src =" .aoc_tiles/tiles/2023/08.png " width =" 161px " >
32
32
</a >
33
+ <a href =" 2023/09/09.py " >
34
+ <img src =" .aoc_tiles/tiles/2023/09.png " width =" 161px " >
35
+ </a >
33
36
<h1 align =" center " >
34
37
2022 - 50 ⭐
35
38
</h1 >
You can’t perform that action at this time.
0 commit comments