Initial commit
This commit is contained in:
commit
b1394d905a
18 changed files with 6496 additions and 0 deletions
12
day1/1.py
Normal file
12
day1/1.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
with open(r'day1/input.txt', 'r') as input:
|
||||
lines = input.read().split('\n')[:-1]
|
||||
|
||||
|
||||
count = 0
|
||||
curr = 50
|
||||
for line in lines:
|
||||
rot,num = line[0],int(line[1:])
|
||||
curr += num if rot == "R" else -num
|
||||
if curr%100 == 0: count += 1
|
||||
|
||||
print(count)
|
||||
Loading…
Add table
Add a link
Reference in a new issue