Insertion Sort

4.2

10 votes
Very-Easy
Problem

You have been given an A array consisting of N integers. All the elements in this array are guaranteed to be unique. For each position i in the array A you need to find the position A[i] should be present in, if the array was a sorted array. You need to find this for each i and print the resulting solution.

Input Format:

The first line contains a single integer N denoting the size of array A. The next line contains N space separated integers denoting the elements of array A.

Output Format:

Print N space separated integers on a single line , where the Ith integer denotes the position of A[i] if this array were sorted.

Constraints:

1N100

1A[i]100

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?