Replay the Events Backwards
Basic SolvedA debugging view replays a sequence of events from newest to oldest. Given the events in order, return them reversed.
Implement `solve(List<Integer> nums)` to return the values in reverse order.
Examples
Input
[1, 2, 3, 4, 5]Output
[5, 4, 3, 2, 1]Input
[9]Output
[9]Hints
- Iterate from the last index down to 0, adding each to the result.
Tests
Solved on this device only. Sign in with Google to keep your progress across devices.
Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically. Keyboard users: press Esc then Tab to move focus out of the editor.