Search
⌘K

Leetcode 1198. Find Smallest Common Element in All Rows

Given an m×n matrix where each row is sorted in non-decreasing order, find the smallest integer that appears in every row (or return -1 if none). Exploit the row ordering (e.g., multi-pointer advancement or frequency counting across rows) to detect a common element efficiently.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.