← All problemsSign in

MATRIX RELOADED

There is a 2D matrix of A rows and B columns. Rows are number from 1 to A from top to bottom and colums from 1 to B from left to right.you are at (1,1). Now in matrix M, From M[i][j] you can move to M[i+1][j] if M[i][j+1]>M[i][j],Or from M[i][j] you can move to M[i][j+1] if M[i][j+1]>M[i][j]. Now you have to move from (1,1). What is the longest path you can travel?. Input Format - First line

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