...

/

Solution: Lucky Numbers in a Matrix

Solution: Lucky Numbers in a Matrix

Let’s solve the Lucky Numbers in a Matrix problem using the Graphs pattern.

Statement

Given an m×nm \times n matrix of distinct numbers, return the lucky number in the matrix.

lucky number is an element of the matrix such that it is the smallest element in its row and largest in its column.

Constraints:

  • m=m = ...

Access this course and 1400+ top-rated courses and projects.