Problem Submissions Leaderboard Discussions This problem is designed for you to improvise on how to read input and format the output.
Input Format
The first line of the input contains the value n and k where n is the number of lines in the input and each input line will have k integers.
Constraints
1 <= n <= 100
1 <= k <= 10
Each integer is > 0 and <= 10
Output Format
Find the frequency of each integer and print them in the specific format as follows: Repeat the following for each integer. Integer followed by colon and followed by space and followed by the frequency If there is no frequency for a particular integer, then print empty space for that integer. Check the sample output format.
Sample Input 0
5 5
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
5 6 7 8 9
Sample Output 0
1: 5
2: 5
3: 5
4: 5
5: 1
6: 1
7: 1
8: 1
9: 1
10:
k = input()
a = k.split()
b =[]
for v in range(int(a[0])):
k = input()
m = k.split()
b += m
result = ["1","2","3","4","5","6","7","8","9","10"]
for i in result:
a = b.count(i)
if a != 0:
print(str(i)+": "+str(a))
else:
print(str(i)+": "+"")