generated from public/aoc_template
day1 - always forget about zip()
This commit is contained in:
parent
9a41c6d42a
commit
e2d0b80706
2
day01.py
2
day01.py
@ -26,7 +26,7 @@ class Day(AOCDay):
|
|||||||
|
|
||||||
def part1(self) -> Any:
|
def part1(self) -> Any:
|
||||||
lefts, rights = self.parse_input()
|
lefts, rights = self.parse_input()
|
||||||
return sum(abs(lefts[x] - rights[x]) for x in range(len(lefts)))
|
return sum(abs(l - r) for l, r in zip(lefts, rights))
|
||||||
|
|
||||||
def part2(self) -> Any:
|
def part2(self) -> Any:
|
||||||
lefts, rights = self.parse_input()
|
lefts, rights = self.parse_input()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user