Problem of the day
N = 3 M = 3
ARR = [ [3, 4, 5], [2, 7, 6] , [1, 2, 4] ]
Ninja at Position (0,0) has maximum skill in ‘0th’ column and minimum skill in ‘0th’ row, it is the only Chunin Ninja.
So, we return [ 3 ] as our ‘ANS’.
The first line contains an integer ‘T’ denoting the number of test cases. Then each test case follows.
The first input line of each test case contains two integers, ‘N’ and ‘M’, denoting the number of rows and columns in the matrix ‘ARR’, respectively.
Each of the following for each test case. Print ‘N’ lines contain ‘M’ space-separated integers denoting the skill level of Ninjas.
For each test case, print all ‘Chunin’ Ninja present in the class. Print the output of each test case in a new line.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= N , M <= 10^5
0 <= ARR[i][j] <= 10^9
Sum of N*M over all Test cases <= 10^5
Time Limit: 1 sec
2
2 2
3 4
2 5
2 3
3 4 5
4 5 6
3
4
For test case 1,
With skill level '3' at position (0,0), the Ninja is the only 'Chunin' Ninja as it has maximum skill level in its column and minimum skill level in its row.
For test case 2,
With skill level '4' at position (1,0), the Ninja is the only 'Chunin' Ninja as it has maximum skill level in its column and minimum skill level in its row.
1
1 1
1
1