aoc 2017 (day 1-6)
This commit is contained in:
18
www/statics/aoc/2017/02_solution-2.py
Normal file
18
www/statics/aoc/2017/02_solution-2.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import aoc
|
||||
|
||||
|
||||
rawinput = aoc.read_input(2)
|
||||
|
||||
result = 0
|
||||
for line in rawinput.splitlines():
|
||||
values = list(map(lambda d: int(d), line.split('\t')))
|
||||
for v1 in values:
|
||||
for v2 in values:
|
||||
if v1 == v2:
|
||||
continue
|
||||
if v1 % v2 == 0:
|
||||
result = result + v1//v2
|
||||
|
||||
print(result)
|
||||
Reference in New Issue
Block a user