Python
Sets of tuples and iteration for both first and second parts. A list of tuples used as a stack for the conversion of recursion to iteration. Dictionary of legal trail moves for traversal. Type hints for antibugging in VSCode. Couple of seconds runtime for each part.
https://github.com/jdnewmil/aocpy/blob/master/aocpy%2Faoc2024%2Fday10.py
Not “debugging” … the value comes before I even try to run the code. The background syntax checker highlights when the types don’t agree into and out of each function call and I don’t get errors like trying to index into an integer.
As for time… I guessed… I did not measure. I have limited time to play with this and don’t optimize unless I find myself waiting excessively for an answer.