mirror of
https://github.com/thib8956/advent-of-code.git
synced 2026-02-27 10:48:14 +00:00
- 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
14 lines
350 B
Python
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())
|
|
|