Find Peak Element II

Hard

📝 Description

Find peak element in 2D array (greater than all neighbors)

Input Format

m n followed by m x n matrix elements row-wise

Output Format

Coordinates of peak element

Constraints

1 ≤ m, n ≤ 500

🔍 Sample Input

3 3
1 4 3
6 5 2
7 8 9
            

✅ Sample Output

1 0
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run