mirror of
https://github.com/SrIzan10/adventofcode.git
synced 2026-06-16 00:02:43 +00:00
21 lines
411 B
Python
21 lines
411 B
Python
input = open('input.txt', 'r').read().splitlines()
|
|
|
|
def part1():
|
|
calList = []
|
|
sum = 0
|
|
for i in input:
|
|
if i == '':
|
|
calList.append(sum)
|
|
sum = 0
|
|
continue
|
|
sum += int(i)
|
|
|
|
calList.sort(reverse=True)
|
|
return calList
|
|
|
|
def part2():
|
|
threeHighest = part1()[:3]
|
|
return sum(threeHighest)
|
|
|
|
print('Part1:', part1()[0])
|
|
print('Part2:', part2()) |