2018d1 solution, slow, very slow, missing framework
This commit is contained in:
parent
8d6cfe70ee
commit
520791da78
18
aoc2018.nim
18
aoc2018.nim
@ -1,4 +1,18 @@
|
|||||||
|
import std/sequtils
|
||||||
import tools/aoc
|
import tools/aoc
|
||||||
|
|
||||||
var test: AOCDay = initAOCDay(1)
|
let test: AOCDay = initAOCDay(1)
|
||||||
echo test.getInput()
|
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
|
||||||
|
|||||||
1032
inputs/input01
1032
inputs/input01
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user