3 ms·
Here is an ES6 fiddle with the completed solution. Where is the flaw? http://www.es6fiddle.net/i6gs4jik/ http://www.es6fiddle.net/i6gs4jik/
by picks_at_nits 12y ago
Here is an ES6 fiddle with the completed solution.
Where is the flaw?
http://www.es6fiddle.net/i6gs4jik/ http://www.es6fiddle.net/i6gs4jik/
- Udik 12y agoThe flaw is in the design. You're passing to the tortoiseAndHare function an iterable, but the only data you have access to, as per requirements, should be represented by an iterator. In other words, you're not free to iterate the moves of the game as many times as you please; the moves come in a single sequence. Adjust your code to keep track of those moves, and the solution becomes (almost) equivalent to the simple one.
- picks_at_nits 12y agoI think a good interview process would involve suggesting that the solution as given does not meet that interpretation of requirements, and asking the candidate to discuss/adjust, as you suggest. A poor process would fail the candidate outright without discussion or explanation. You’ll notice, for example, that Christine asking him to try out his code while she reads out the moves doesn’t match the template she provided, either. JM2C.