diff options
author | Thomas Voss <thomasvoss@live.com> | 2021-12-08 15:15:05 +0100 |
---|---|---|
committer | Thomas Voss <thomasvoss@live.com> | 2021-12-08 15:15:05 +0100 |
commit | 6d3b07cdf6cd46261a2e3524b39a809602c9b157 (patch) | |
tree | c56b36f4eb4d1f1e6bae64cbad23a53596402988 /2020/09 | |
parent | c472b1be1a2042ecffabc7cb90f4f908f08256b2 (diff) |
Do not hardcode the goal
Diffstat (limited to '2020/09')
-rwxr-xr-x | 2020/09/puzzle-2.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/2020/09/puzzle-2.py b/2020/09/puzzle-2.py index c890fb3..b560a29 100755 --- a/2020/09/puzzle-2.py +++ b/2020/09/puzzle-2.py @@ -1,10 +1,12 @@ #!/usr/bin/env python3 +import subprocess + import numpy as np def main() -> None: - goal = 138879426 + goal = int(subprocess.run(["./puzzle-1.py"], capture_output=True, text=True).stdout) with open("input", "r", encoding="utf-8") as f: nums = np.array(list(map(int, f.readlines())), dtype=int) |