Loading...
Loading...
Loading...
A clerk wants a list of order numbers in reverse order. Reverse the list in place using two pointers that swap values, then print it. Do not use reverse() or slicing in your solution.
Example
Input
1 2 3 4 5
Output
5 4 3 2 1
Try the problem first. Open one hint at a time.
Swap the first and last values, then the second and second-last.
Stop when the pointers meet.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor