aoc2018/aoc2018.nim
2021-12-14 15:07:31 +01:00

19 lines
334 B
Nim

import std/sequtils
import tools/aoc
let test: AOCDay = initAOCDay(1)
echo test.getInputInt().foldl(a + b)
var seen: seq[int]
var freq: int = 0
var found: bool = false
while not found:
for x in test.getInputInt():
freq += x
if freq notin seen:
seen.add(freq)
else:
echo freq
found = true
break