You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
279 B
Python

# part 1
print(max([ sum([int(z) for z in x]) for x in [x.split('\n') for x in open('in.txt', 'r').read().split('\n\n') ]]))
# part 2
print(sum(sorted([ sum([int(z) for z in x]) for x in [x.split('\n') for x in open('in.txt', 'r').read().split('\n\n')]], reverse=True)[0:3]))