Novice's Thoughts

Advent Of Code Day 1

https://github.com/Maheshkumar-novice/Advent-Of-Code-Solutions/tree/main/2025/Day-01

I went with the brute force approach for the part 2 because i couldn't find the modulo logic. but it turned to be simple from the solutions i have read from discord and reddit.

They used something like reflections, to convert left to right side values.

Some solutions from the internet.

ROTATIONS = list(extract_ints(aoc_lube.fetch(year=2025, day=1).replace("L", "-")))

def part_one():
    dial = 50
    zeros = 0
    for n in ROTATIONS:
        dial += n
        zeros += dial % 100 == 0
    return zeros

def part_two():
    dial = 50
    zeros = 0
    for n in ROTATIONS:
        at_zero = dial == 0
        r, dial = divmod(dial + n, 100)
        zeros += abs(r)
        if n < 0:
            zeros += (dial == 0) - at_zero
    return zeros
data = input.splitlines()
pos = 50
p1, p2 = 0, 0
for row in data:
    ticks = int(row[1:])
    delta = -1 if row[0] == 'L' else 1
    p2 += ((100+ delta*pos)%100 + ticks)//100
    pos = (pos + delta*ticks)%100
    if pos == 0:
        p1 +=1