day 2 part 1
This commit is contained in:
parent
5827c05c07
commit
b416ab805b
4 changed files with 5007 additions and 0 deletions
6
2.py
Normal file
6
2.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
with open("input2_pre.txt") as f:
|
||||||
|
s = 0
|
||||||
|
for line in f.readlines():
|
||||||
|
a, b = [int(a) for a in line.strip().split()]
|
||||||
|
s += b + ((3, 0, 6)[((a - b) % 3)])
|
||||||
|
print(s)
|
1
2_preproc.sh
Normal file
1
2_preproc.sh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
cat input2.txt | sed "s/X/A/g" | sed "s/Y/B/g" | sed "s/Z/C/g" | sed "s/A/1/g" | sed "s/B/2/g"| sed "s/C/3/g" > input2_pre.txt
|
2500
input2.txt
Normal file
2500
input2.txt
Normal file
File diff suppressed because it is too large
Load diff
2500
input2_pre.txt
Normal file
2500
input2_pre.txt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue