Opening your workspace…
Workspace/Coding room
Opening your workspace…
One pair of boots serves an entire lane. Each morning their owner passes them to the neighbour on their slip. House numbers start at zero and nextHouse[i] is the number written at house i. Given the starting house, return the first house to receive the boots twice. Count the starting house as their first visit. Practice rank · 6 kyu (Brewery estimate).
[2,3,1,2], 0OUTPUT2The boots visit 0, 2, 1, 3, then 2 again.
[0], 0OUTPUT0The sole tenant leaves the boots on her own step.
Keep the numbers of houses with muddy doormats.
function solve(nextHouse, start) { // Write your answer here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.
[2,3,1,2], 02