adventofcode/2022/01/01.py

19 lines
373 B
Python
Raw Normal View History

2022-12-01 18:13:18 +01:00
#!/usr/bin/env python3
INPUT_FILE = 'input'
def main():
content = list(map(str.strip, open(INPUT_FILE, 'r').readlines()))
elfs = []
cal_sum = 0
for line in content:
if line == '':
elfs.append(cal_sum)
cal_sum = 0
continue
cal_sum += int(line)
print(max(elfs))
if __name__ == '__main__':
main()