mirror of
https://github.com/thib8956/advent-of-code.git
synced 2025-08-24 08:21:57 +00:00
make 2020 compatible with run.py
This commit is contained in:
@@ -18,7 +18,13 @@ def part2(adapters):
|
||||
return max(counts.values())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
adapters = sorted(int(l.rstrip()) for l in open("input.txt"))
|
||||
def main(f):
|
||||
adapters = sorted(int(l.rstrip()) for l in f)
|
||||
print(part1(adapters))
|
||||
print(part2(adapters))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import fileinput
|
||||
main(fileinput.input())
|
||||
|
||||
|
Reference in New Issue
Block a user