Opening your workspace…
Workspace/Coding room
Opening your workspace…
A tasting counter records ticket edits in order. A positive integer adds that ticket number to the end of the board. A zero undoes the most recent ticket still on the board; if the board is empty, the zero does nothing. Return the final ticket numbers from oldest to newest. Repeated numbers represent separate tickets, and an undo does not restore an earlier undone ticket.
[8,3,0,5]OUTPUT[8,5]Ticket 3 is undone. Ticket 8 remains before the newly added ticket 5.
[0,4,0,0]OUTPUT[]The first zero has nothing to undo. The next removes ticket 4, and the last again does nothing.
Tab inserts two spaces. Press Escape, then Tab, to leave the editor. Press Control or Command and Enter to submit.
[8,3,0,5][8,5]Public samples only. These checks do not award ranked points.
Walk through a solution, check its time and space costs, and compare it with yours.
Checking your progress…