AlgoUniversity
  • Go Back
Discussion
Reshelving Packets :

Author

Akshay Sharma

Difficulty Level : Medium

Submissions : 175

Asked In : PayPal

Marks :100

: 1 | : 0

You are given N shelves ranging from 0 to n-1 name shelve ($$$shelve_i ,shelve_{i+1}.....shelve{n-1}$$$).

Range of shelves from 1 to 99 inclusive. Given them to the minimum value possible and return the array in the same order through

Input

The first line of each test case contains a single integer N ($$$1 \le N \le 1e5 $$$).

The next line contains the N integers separated by the space name shelve ($$$1 \le shelve_i \le 99$$$)

Output

For each test case print the array of integers that is the reshelve them to the minimum value possible

Examples

Input
4
1 12 4 12
Output
1 3 2 3
Input
4
1 2 6 5
Output
1 2 4 3

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.