Problem
Ask
Submissions

Problem: Lucky Numbers in a Matrix

Easy
15 min
Explore techniques to find lucky numbers in an m by n matrix, where each lucky number is the smallest value in its row and largest in its column. Understand the problem constraints, apply logical reasoning, and practice implementing efficient solutions in an interactive coding environment.

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 = matrix.length

  • n=n = matrix[i].length

  • 1n1 \leq n, m50m \leq 50

  • 11 \leq matrix[i][j] 105\leq 10^5

  • All elements in the matrix are distinct.

Problem
Ask
Submissions

Problem: Lucky Numbers in a Matrix

Easy
15 min
Explore techniques to find lucky numbers in an m by n matrix, where each lucky number is the smallest value in its row and largest in its column. Understand the problem constraints, apply logical reasoning, and practice implementing efficient solutions in an interactive coding environment.

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 = matrix.length

  • n=n = matrix[i].length

  • 1n1 \leq n, m50m \leq 50

  • 11 \leq matrix[i][j] 105\leq 10^5

  • All elements in the matrix are distinct.