NeetCode #26LC-1198MediumArrays & HashingNC Algo100
← Back to All Problems

#26 · #1198 · Find Smallest Common Element in All Rows(找出所有行中最小的公共元素)

📌 Problem Statement & Constraints

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. Constraints: 1 <= m, n <= 500, 1 <= mat[i][j] <= 10^4, each row is strictly increasing.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!