1198. Find Smallest Common Element in All Rows
https://leetcode.com/problems/find-smallest-common-element-in-all-rows
Description
Given an m x n
matrix mat
where every row is sorted in strictly increasing order, return the smallest common element in all rows.
If there is no common element, return -1
.
Example 1:
Example 2:
Constraints:
m == mat.length
n == mat[i].length
1 <= m, n <= 500
1 <= mat[i][j] <= 104
mat[i]
is sorted in strictly increasing order.
ac
Last updated