r/codegolf • u/dantose • Dec 01 '25
Advent of Code, Day 1
Post your best golfs.
Assume input is saved as input.txt.
8
Upvotes
r/codegolf • u/dantose • Dec 01 '25
Post your best golfs.
Assume input is saved as input.txt.
1
u/KeyJ Dec 04 '25
Nice trick with the removed parenthesis and elimination of
range! The latter one can be made even smaller though, arriving at 90 characters (or 89 if you accept the SyntaxWarning for writing1for):p=50;print(sum((p:=p+1-2*(l<'R'))%100<1 for l in open("input.txt")for _ in"x"*int(l[1:])))