Answer: IBM OA Question 2024 August | Dynamic Programming | on-campus

Answer · Posted Jun 2026

Solution: Minimum Path Sum — 2D DP (In-Place) Approach We can solve this problem using **Dynamic Programming**. The minimum path sum to reach any cell (i, j) is the value of the cell itself plus the minimum of the paths to reach its top neighbor (i-1, j) and left neighbor (i, j-1). We can optimize space to O(1) by updating values in the input grid directly: For cells in the first row (i == 0), we can only arrive from ...

The full answer & interview discussion are available to premium members.

Log in Create a free account