Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-cannell authored Aug 31, 2023
0 parents commit adc99cc
Show file tree
Hide file tree
Showing 17 changed files with 8,054 additions and 0 deletions.
2,251 changes: 2,251 additions & 0 deletions Advent_Of_Code_2022/day1/adventofcode20222_day1_data.csv

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Advent_Of_Code_2022/day1/day1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
data = [lst.strip() for lst in open("adventofcode20222_day1_data.csv")]
totals, total = [], 0
for calories in data:
if calories == "":
totals.append(total)
total = 0
else:
total += int(calories)
totals = sorted(totals)
print(totals[-1], totals[-1] + totals[-2] + totals[-3])
Loading

0 comments on commit adc99cc

Please sign in to comment.