Loading...
Loading...
Loading...
A list of orders is stored as nodes. Put a new order x at the front, then add an order y at the end. Print the list.
Example
Input
5 6 7 1 9
Output
1 5 6 7 9
Try the problem first. Open one hint at a time.
The front insert is Node(x, head).
For the end, walk until node.next is None.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor