← MakeMyTrip questions

Minimum cost path in a matrix

Filed under MakeMyTrip

Given an $M \times N$ grid filled with non-negative numbers, find a path from the top-left $(0,0)$ to the bottom-right $(M-1, N-1)$ that minimizes the sum of all numbers along its path. You can only…

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

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