← All problemsSign in

Matrix Search

Input : First line contains 2 integers n and m, which are matrix dimensions. The next n lines contain m integers separated by space, which are elements of a sorted matrix, where rows and columns are sorted and last element of row i-1 is <= 1st element of row i. . An integer x follows, which is present in matrix. Output : 2 integers r c, indicating lexicographically lowest position of x. Examp

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start