Problem Description
You are given an integer array A.
You have to find the number of occurences of each number.
Return an array containing only the occurences with the smallest value's occurence first.
For example, A = [4, 3, 3], you have to return an array [2, 1], where 2 is the number of occurences for element 3,
and 1 is the number of occurences for element 4. But, 2 comes first because 3 is smaller than 4.
A = [1, 2, 3]
Input 2:
A = [4, 3, 3]
[1, 1, 1]
Output 2:
[2, 1]
All the elements occur once, so the resultant array should be [1, 1, 1].
Explanation 2:
Explained in the description above.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.