O54
Minimum Path Sum Matrix
Problem Statement & Objective
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
Function Signature (Python)
minimum_path_sum_matrix(grid: list[list[int]]) -> intInput & Output Contract
Output Rule:Minimum yol toplamı.
System Constraints
m == izgara.length, n == izgara[i].length
1 <= m, n <= 200
0 <= izgara[i][j] <= 200Example Execution Walkthrough
izgara = [[1, 3, 1], [1, 5, 1], [4, 2, 1]]
1 -> 3 -> 1 -> 1 -> 1 toplamı 7 -> cevap: 7Example Test Scenarios (3)
Example 1
Input:
[[[1,3,1],[1,5,1],[4,2,1]]]Expected Output:
7Example 2: 1+2+3+6 = 12
Input:
[[[1,2,3],[4,5,6]]]Expected Output:
12Example 3: 1x1
Input:
[[[5]]]Expected Output:
5