Find Matrix Centers with Local Maximum in Defined Squares

Asked at Amazon · Coding Questions · Difficulty: Medium

Given a matrix, find all the locations of the values that meet the following condition: Each value, called the center value, must ensure that in a square matrix of size `value * 2 + 1` centered around it, all positions except the four corners do not have a number greater than itself. Output the coordinates of all eligible center values.

Loading the problem…