Files
advent-of-code/adventofcode/2019/day9/day9.py
Thibaud f783ff0d6d chore: make intcode an installable package
- Move intcode/ from 2019/ folder to the root of the repository
- The package is automatically installed with the adventofcode package
  with `pip install -e .` command
2026-02-17 19:11:50 +01:00

14 lines
350 B
Python

from adventofcode.intcode import interpret_intcode
def main(inp):
mem = list(map(int, inp.readline().rstrip().split(",")))
print("Part 1: ", interpret_intcode(mem[::], stdin=[1]).stdout[0])
print("Part 2: ", interpret_intcode(mem[::], stdin=[2]).stdout[0])
if __name__ == "__main__":
import fileinput
main(fileinput.input())