was preparing my butthole after the last one but ended up being the fastest one i've done
with open("day6input.txt") as f:
input = f.read()
# part 1
for i in range(len(input)):
marker = set(input[i:i+4])
if len(marker) == 4:
answer = i + 4
break
print(answer)
# part 2
for i in range(len(input)):
marker = set(input[i:i+14])
if len(marker) == 14:
answer = i + 14
break
print(answer)
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
King reduce that input file name, you're wasting bytes.![:marseykingcrown: :marseykingcrown:](/e/marseykingcrown.webp)
Jump in the discussion.
No email address required.
Thanks for the advice king, two lines was bloat
{1-⍨⍵+⍵⍳⍨↑¨⍴¨⍵∪/⎕FIO[26]'6'}¨4 14
Jump in the discussion.
No email address required.
More options
Context
More options
Context
is my browser even rendering those characters properly?
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
More options
Context
More options
Context