← Amazon questions

Find common element in row-sorted matrix

Filed under Amazon

Given an M x N matrix where each row is sorted in ascending order, find an element that appears in every row of the matrix. If multiple exist, any valid one can be returned; if none exist, return -1.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.