summaryrefslogtreecommitdiff
path: root/2022/day01/main.py
blob: 7ac4153033c4790b5470e37b26a08d7dbcfe613d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

cal=0
elf=1
maxelf=0
calmax1=0
calmax2=0
calmax3=0
for line in open("input2.txt", "r"):
    # print(line)
    if( line == "\n" ):
        cal=0
        elf += 1
        continue
    cal += int(line)
    if (cal > calmax1 && elf > max):
        calmax3 = calmax2
        calmax2 = calmax1
        calmax1 = cal
    # calmax = max(calmax, cal)
print(calmax1, calmax2, calmax3)