diff --git a/day9.py b/day9.py new file mode 100644 index 0000000..c3cf051 --- /dev/null +++ b/day9.py @@ -0,0 +1,40 @@ +day = "day9" +file = f"inputs/{day}.txt" + + + +def part_one(file): + result = 0 + input = open(file, "r") + input = input.readlines() + numbers = [] + for i in input: + numbers.append(int(i)) + + + for number in range(0,len(numbers)): + for nextnumber in range(1,len(numbers)): + if numbers[number] + numbers[nextnumber] in numbers: + break; + else: + rvnumber = numbers[number] + numbers[nextnumber] + print(rvnumber) + + + + print(f"Part 1: {result}") + + + + +def part_two(file): + result = 0 + input = open(file, "r") + input = input.readlines() + + + + print(f"Part 2: {result}") + +part_one(file) +part_two(file) \ No newline at end of file diff --git a/inputs/day9.txt b/inputs/day9.txt index e69de29..cda4246 100644 --- a/inputs/day9.txt +++ b/inputs/day9.txt @@ -0,0 +1,20 @@ +35 +20 +15 +25 +47 +40 +62 +55 +65 +95 +102 +117 +150 +182 +127 +219 +299 +277 +309 +576 \ No newline at end of file