You are given an array a that contains N integers. All the integers in the array may not be distinct.
The number of repetitions of each integer in the array is represented by
Your task is to print the integers in the decreasing order of their occurrence in the array.
ri>rj, then ai must be printed before aj.
ri==rj, then among ai and aj whichever has a larger value, is printed
rj are the number of repetitions of integers
aj in the array.
Please read the sample explanation carefully to understand the task that you have to perform.
• The first line contains an integer
• The second line contains
N space-separated integers representing the
elements of array
Print the space-separated integers in the decreasing order of their occurrence in the array. The output must be printed in a single line.
Source: Windows Questions C++