mirror of
https://github.com/sstent/Advent2021.git
synced 2026-01-27 17:42:17 +00:00
39 lines
687 B
Python
39 lines
687 B
Python
from aocd import get_data
|
|
from aocd import submit
|
|
input_data = get_data(day=1, year=2021)
|
|
|
|
|
|
|
|
test_data = """199
|
|
200
|
|
208
|
|
210
|
|
200
|
|
207
|
|
240
|
|
269
|
|
260
|
|
263"""
|
|
|
|
lines = input_data.split("\n")
|
|
|
|
|
|
|
|
count = 0
|
|
down_count = 0
|
|
for index, value in enumerate(lines):
|
|
# if index != 0:
|
|
if int(value) > int(lines[index - 1]):
|
|
print(str(index)+ ": " + str(value) + " + "+ str(lines[index - 1]))
|
|
# print("1")
|
|
count += 1
|
|
else:
|
|
print(str(index)+ ": " + str(value) + " < "+ str(lines[index - 1]))
|
|
# print("0")
|
|
down_count += 1
|
|
|
|
print("Input length:" + str(len(lines)))
|
|
print(count)
|
|
print(down_count)
|
|
#submit(count)
|