← FactSet questions

Print sorted matrix elements in sorted order

Filed under FactSet

Given an N x N matrix where each row and column is sorted in non-decreasing order, print all elements in non-decreasing order. The solution must use no more than O(N) extra space.

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 FactSet questions

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