[Python/2017] Move solutions into .py files
This commit is contained in:
parent
fbc5fda60f
commit
7b1efc0d9c
51 changed files with 1100 additions and 4546 deletions
10
Python/2017/01.py
Normal file
10
Python/2017/01.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
from lib import *
|
||||
|
||||
input = read_input(2017, 1).strip()
|
||||
|
||||
|
||||
print(sum(int(a) for a, b in zip(input, input[1:] + input[0]) if a == b))
|
||||
|
||||
|
||||
n = len(input) // 2
|
||||
print(sum(int(a) for a, b in zip(input, input[n:] + input[:n]) if a == b))
|
Loading…
Add table
Add a link
Reference in a new issue