Skip to content

Commit

Permalink
add first dec 2022 plus 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
lismith2-cisco committed Dec 1, 2022
0 parents commit aafea89
Show file tree
Hide file tree
Showing 22 changed files with 7,992 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 2021_1_mum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
f = open("2021_1_warmup_input.txt")

count = 0
prev = None

for line in f:
depth = int(line)
if prev is None:
pass
elif depth > prev:
count += 1
prev = depth

print(count)
14 changes: 14 additions & 0 deletions 2021_1_warmup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
f = open("2021_1_warmup_input.txt")
numbers = [int(line) for line in f]

larger_count = 0
prev = None

for three_elements in zip(numbers, numbers[1:], numbers[2:]):
three_total = sum(list(three_elements))
if prev is not None:
if prev < three_total:
larger_count += 1
prev = three_total

print(larger_count)
Loading

0 comments on commit aafea89

Please sign in to comment.