blob: 0a894cacefec5261e94018e52fea5195a5516aea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/usr/bin/env python3
def main() -> None:
with open("input", "r") as f:
nums = [int(n) for n in f.readlines()]
# START PART 2
nums = [nums[i] + nums[i - 1] + nums[i - 2] for i in range(2, len(nums))]
# END PART 2
print(sum(nums[i] > nums[i - 1] for i in range(1, len(nums))))
if __name__ == "__main__":
main()
|