You are collaborating with a tech team for an EdTech organisation. It is currently working on a special feature for Instructors' dashboard which will help the instructor in knowing about the engagement of his students for the class Assignments in the form of number of times a particular student contacts his/her TA (Teaching Assistant) on a particular day.
So whenever a student with an id i contacts his TA on jth day, i is stored in the jth row of a matrix for that particular batch. As you can see this data storage can become very large as a student can contact his/her TA multiple times in a day and there can be a significant number of batches also. The team is facing this storage issue.
Here you are asked to create a prototype program which is just for a batch of 10 students and for m days for visualising the solution on a large scale.
For the program the input matrix consists of elements with values 1-10 (students' ids) of dimension mxn, the output is expected to be a 2d list of dimension m*10 (m is the number of days and 10 columns because students number is only 10 here), but this time the elements will be the count of the that element in that particular row i.e. the number of times a student contacts on ith day.
Input Format:
number of test cases
for each test case (number of rows for matrix)
for each row in matrix space separated integers in a new line
Output Format:
The 2dlist is simply printed
Sample input:
1
5
1 1 2 5 7 6 7 7 6 3
8 5 4 7 5 2 6 10 1 7
4 3 10 4 4 4 3 1 4 3
1 4 1 1 8 4 9 8 5 5
1 1 4 4 2 10 5 6 8 1
Sample output:
[[2, 1, 1, 0, 1, 2, 3, 0, 0, 0], [1, 1, 0, 1, 2, 1, 2, 1, 0, 1], [1, 0, 3, 5, 0, 0, 0, 0, 0, 1], [3, 0, 0, 2, 2, 0, 0, 2, 1, 0], [3, 1, 0, 2, 1, 1, 0, 1, 0, 1]]
where you can see that in the output[0][0], the element is 1 which depicts that 1 occurs only single time in the 1st row in the input matrix.
Note:
- Here you don't have to write the code for taking input its already included in the code suffix which you would be able to see right below the function editor.
- The output is a simple 2d matrix(2d list) printed simply without any formatting.