day 6 didn't seem so bad
local seqlen = 14; local uniq(arr) = std.length(arr) == std.length(std.set(arr)); local findfirst(arr, x) = std.find(x, arr)[0]; local finduniqseq(arr, len) = [ uniq(arr[offset:offset + len]) for offset in std.range(0, std.length(arr) - len) ]; findfirst(finduniqseq(importstr 'input', seqlen), true) + seqlen
Not very performant (it computes uniqueness over the whole input, then finds the first occurrence)
@rhowe started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
day 6 didn't seem so bad
Not very performant (it computes uniqueness over the whole input, then finds the first occurrence)