MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / main

Function main

2018/src/01.py:5–12  ·  view source on GitHub ↗
(indata: str)

Source from the content-addressed store, hash-verified

3
4@aoc.main('01')
5def main(indata: str) -> tuple[int,int]:
6 nums, seen, s = [int(l) for l in indata.split('\n')], set(), 0
7 for x in cycle(nums):
8 s += x
9 if s in seen:
10 break
11 seen.add(s)
12 return sum(nums), s
13
14if __name__ == "__main__":
15 main()

Callers 1

01.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected