Search⌘ K
AI Features

Solution: Lucky Numbers in a Matrix

Solution: Lucky Numbers in a Matrix asks you to find the matrix element that is smallest in its row and largest in its column, with all values distinct.

Statement

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

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

Constraints:

  • ...