#K4261. Difficulty Level Counting
Difficulty Level Counting
Difficulty Level Counting
You are given multiple test cases. In each test case, you are given a list of problem difficulties, where each difficulty is an integer between 1 and 10. Your task is to count the frequency of each difficulty level from 1 to 10 for every test case and output the counts in order.
For each test case:
- The first line contains an integer N, representing the number of problems.
- The second line contains N space-separated integers, each indicating the difficulty level of a problem.
Print a single line for each test case containing 10 space-separated integers corresponding to the counts of difficulty levels 1 through 10. If a difficulty level does not appear, output 0 for that position.
The problem can be expressed mathematically as: for each test case and for each difficulty level ( d ) where ( 1 \leq d \leq 10 ), compute:
[ count_d[d] = \text{number of occurrences of } d \text{ in the given list} ]
Good luck!
inputFormat
The input begins with an integer T, the number of test cases. For each test case, the following is provided:
- An integer N on a new line, denoting the number of problems.
- A line with N space-separated integers, each indicating a difficulty level from 1 to 10.
For example:
2
5
1 2 2 3 3
7
4 4 5 5 6 6 6
This represents 2 test cases. The first test case has N = 5 and the second has N = 7.
outputFormat
For each test case, output a single line containing 10 space-separated integers. These integers represent the counts of problems with difficulties 1 through 10 respectively.
For the sample input provided above, the correct output would be:
1 2 2 0 0 0 0 0 0 0
0 0 0 2 2 3 0 0 0 0## sample
1
5
1 2 2 3 3
1 2 2 0 0 0 0 0 0 0
</p>