Unable to load image

Advent of Code day 6

was preparing my butthole after the last one but ended up being the fastest one i've done :marseyexcited:

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)
28
Jump in the discussion.

No email address required.

I'm getting 2019 Intcode flashbacks, where AoC had us build up a signal processor over about 10 days. This was too easy, we haven't seen the last of it.

Jump in the discussion.

No email address required.

:#marseyworried:

i wonder how long it's going to be before there's a task i completely give up on

Jump in the discussion.

No email address required.

He normally throws a nasty question in around day 16, at that point I either ragequit AoC for the year or just skip that one day.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.