Triangle
2D/3D DP and Grids DSA practice problem on Onlearn.
Difficulty: medium.
Topics: Minimum Path Sum in Triangular Grid, Dynamic Programming, Recursion, Memoization, Tabulation, Space Optimization, Time Complexity, Space Complexity, Matrices, Two-dimensional Array Traversal, Greedy Algorithm, space complexity, dynamic programming, memoization, tabulation, space optimization, recursion, time complexity analysis, greedy algorithm limitations.
Minimum Path Sum in Triangular Grid Problem Statement You are given a triangular matrix (grid). Your task is to find the minimum path sum from the top cell (row 0, column 0) to any cell in the last row. From any cell (i, j), you can move only to the bottom cell (i+1, j) or to the bottom right cell (i+1, j+1). Input Specification The input is a 2D integer array representing the triangular grid. The i th row contains i+1 elements. Output Specification Return a single integer, the minimum path sum. Example