You are reading a single comment by @rhowe and its replies. Click here to read the full conversation.
  • 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)

About

Avatar for rhowe @rhowe started