Imagine the actual interface to this problem being a person calling out “left”, “up”, “left”, etc. To run tortoise-and-hare in your head on this input, you’d have to remember what they’d called out, to an unbounded span backwards. I don’t know about ES6 iterators, but the solution seems to amount to cloning the person calling out the directions.
You are absolutely correct about that, and it was no accident. I was trying to show that the Carpenter was trying to force-fit cycle-detection onto this problem, mostly because Plissken had coached him that Thing liked to test whether Candidates knew how to solve it.
I see! I wondered at the time if following your blog more would have filled in some context. (I’m on a bit of an internet diet lately… relatively at least.)
Got a nice follow-up post from the author correcting an error or two and explaining a little more.
Imagine the actual interface to this problem being a person calling out “left”, “up”, “left”, etc. To run tortoise-and-hare in your head on this input, you’d have to remember what they’d called out, to an unbounded span backwards. I don’t know about ES6 iterators, but the solution seems to amount to cloning the person calling out the directions.
You are absolutely correct about that, and it was no accident. I was trying to show that the Carpenter was trying to force-fit cycle-detection onto this problem, mostly because Plissken had coached him that Thing liked to test whether Candidates knew how to solve it.
I see! I wondered at the time if following your blog more would have filled in some context. (I’m on a bit of an internet diet lately… relatively at least.)