Submit | All submissions | Best solutions | Back to list |
RG11 - SORT FREQUENCY OF INTEGER GRADO 11 |
Sort Frequency of Integers
Code a program that reads a unidimensional array of integers and prints in descending order the frequency of the integers in the array.
Input: A sequence of integer numbers where the first one is a positive integer that represents the amount of numbers in the rest of the line.
Output:
The frequencies of the input numbers sorted in descending order.
Input
9 4 80 80 30 4 4 80 4 4
Output
5 3 1
Example
Input:4 5 5 5 5
Output:4
Note that the first number in the input, 9, indicates the size of the array. Also, note that 80 appears 3 times; 30, once; and 4, five times.
Added by: | MaratónAFDM |
Date: | 2018-07-31 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C NCSHARP CSHARP C++ 4.3.2 JAVA JULIA PYTHON PYPY3 PYTHON3 |