Loading...
Loading...
Loading...
Orders are read oldest first. Print them newest first, and show each order with its position in the original order (the first order is number 1).
<position>. <code>, from the last order to the first.Example
Input
3 A101 A102 A103
Output
3. A103 2. A102 1. A101
Try the problem first. Open one hint at a time.
An index loop can count down: start at orders.size() - 1 and stop at 0.
The position to print is i + 1.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor