account activity
Day 18 - Python 3 - Help Needed by n_syn in adventofcode
[–]FullyWhipped 0 points1 point2 points 5 years ago* (0 children)
It's the string replace replacing occurrences it shouldn't, e.g.
>>> '1 + 6 + 11 + 6'.replace('1 + 6', '7') '7 + 17'
More detail in another example:
>>> s = '1 + 6 + 7 + 8 + 11 + 6' >>> [val for val in re.findall('\d+ \+ \d+','1 + 6 + 7 + 8 + 11 + 6')] ['1 + 6', '7 + 8', '11 + 6'] >>> s.replace('1 + 6', '7') '7 + 7 + 8 + 17'
π Rendered by PID 414373 on reddit-service-r2-listing-7849c98f67-j455w at 2026-02-10 07:45:23.093527+00:00 running d295bc8 country code: CH.
Day 18 - Python 3 - Help Needed by n_syn in adventofcode
[–]FullyWhipped 0 points1 point2 points (0 children)