← All problemsSign in

Chef and Matrix

Chef is playing a game which consists of a matrix with $N$ rows and $M$columns. Where cell $(i,j)$ denotes the cell present at row $i$ and column $j$. Cell $(1,1)$ denotes the top left corner of the matrix.Each cell has some amount of coins associated with it and the player who is playing can collect them only if he visits that cell.From a cell $(i,j)$,he can decide to go to cell $(i+1,j+1)$ or ce

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