In the beautiful capital of Dmojistan, there are
Armed with this information, you are planning to rob all
Before you can start robbing, you need to determine a sequence
Any valid sequence will be accepted.
Constraints
Subtask 1 [50%]
Subtask 2 [50%]
Input Specification
The first line will contain
The next line will contain
Output Specification
Output a valid sequence
Sample Input
5
2 1 1 1 1
Sample Output
1 2 3 4 5
Comments
I don't know what's getting me tle on the second subtask. Any ideas as to why this is happening?
Your algorithm appears to be
(due to ArrayDeque.contains()).
Thanks for the feedback :)