Opening your workspace…
Workspace/Coding room
Opening your workspace…
Supper is served on a turntable. At each click every jar moves one seat to the right, and the jar at the last seat arrives at seat zero. The cook turns it left for negative clicks. Return the jars in seat order after all the clicks. Practice rank · 7 kyu (Brewery estimate).
["jam","salt","mint"], 1OUTPUT["mint","jam","salt"]Mint comes round to the first seat.
["jam","salt","mint"], -1OUTPUT["salt","mint","jam"]Jam moves left across the seam.
A full turn leaves every jar where it started.
function solve(jars, clicks) { // 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.
["jam","salt","mint"], 1["mint","jam","salt"]