Uiua
Today's lesson: Never think that scanning the first 100 lines of input will give you a good understanding of it.
Part 2 is really messy and could probably be much simpler, but I couldn't get the logic straight in my head otherwise.
"L68 L30 R48 L5 R60 L55 L1 L99 R14 L82"
βββΈβ @\sβ§ββ‘β
@Β―ββΈβ"L"β§ββ‘β
@+ββΈβ"R"
Pβ β β§»β=0\(βΏ100+)β50
P β (
β(-Γ100Γ|/+)βΓ·100β΅β(βΈΒ±) # Count and remove all over-rotations
βββΒ―1βΈ(\(βΏ100+)β50) # Take all positions and next moves.
β½βΈβ‘(β 0β’) # Ignore any starting from zero
+/+β₯β(<0|>100)β‘/+ # Sum the pairs, check for passing zero.
)
Pβ β +βP Pβ
β(Pβ|Pβ)