Weird Coins
CodeChefOpen on judge ↗
You are given a $M\times N$ grid and on each cell there is a coin. A coin may have integral value denoted by $C[i][j]$. If you're at a cell $(i,j)$, then you have to pick up the coin present at that cell(whose value is $C[i][j]$) and you can visit a cell $only$ $once$ . You are initially at $(1,1)$ and you have to reach $(M,N)$. Note that you can only move $right$, $up$ or $bottom$ from a given
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.
Sign in to chat with the tutor and save your progress.
Sign in to start