Close
Topic list
The Chunin Ninja
EASY
20 mins
Matrices (2D Arrays)
Topics (Covered in this problem)
Problem solved
Skill meter
Matrices (2D Arrays)
-
-
Other topics
Problem solved
Skill meter
Strings
-
-
-
-
Sorting
-
-
Binary Search
-
-
Stacks & Queues
-
-
Trees
-
-
Graph
-
-
Dynamic Programming
-
-
Greedy
-
-
Tries
-
-
Arrays
-
-
SQL
-
-
Binary Search Trees
-
-
Heap
-
-
Bit Manipulation
-
-
Solve problems & track your progress
Checkout your overall progress in every topic here
Become
Sensei
in DSA topics
Open the topic and solve more problems associated with it to improve your skills
Check out the skill meter for every topic
See how many problems you are left with to solve for cracking any stage. Score more than zero to get your progress counted.

# The Chunin Ninja

Contributed by
Dipanshu Pandey
Easy
0/40
Avg time to solve 20 mins
Success Rate 70 %
Share

## Problem Statement

#### Can you find all the ‘Chunin’ Ninjas present in the class?

##### Example :
``````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’.
``````
Detailed explanation ( Input/output format, Notes, Constraints, Images )
##### Sample Input 1 :
``````2
2 2
3 4
2 5
2 3
3 4 5
4 5 6
``````
##### Sample Output 1 :
``````3
4
``````
##### Explanation Of Sample Input 1 :
``````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.
``````
##### Sample Input 2 :
``````1
1 1
1
``````
##### Sample Output 2 :
`````` 1
``````
Auto
Console