Repository: TheAlgorithms/Python
Pull request: Minmum path sum
### Describe your change:

Added an algorithm that takes a 2 dimensional grid of numbers, and finds the path starting from the top left and ending at the bottom right with the lowest possible sum of numbers along the path. It then returns the sum of all numbers along that path. 

For Example:
Input: [
[1,3,1],
[1,5,1],
[4,2,1]
]

Expected output: 7

* [x] Add an algorithm?
* [ ] Fix a bug or typo in an existing algorithm?
* [ ] Documentation change?

### Checklist:
* [x] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md).
* [x] This pull request is all my own work -- I have not plagiarized.
* [x] I know that pull requests will not be merged if they fail the automated tests.
* [x] This PR only changes one algorithm file.  To ease review, please open separate PRs for separate algorithms.
* [x] All new Python files are placed inside an existing directory.
* [x] All filenames are in all lowercase characters with no spaces or dashes.
* [x] All functions and variable names follow Python naming conventions.
* [x] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
* [x] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
* [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
* [x] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.

fixes #4796

Problem statement:
DSA-Matrix-Python- Minimum Path sum
Hey there, I'm participating in #hactoberfest2k21, Please assign me the issue. Good day!
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.You can only move either down or right at any point in time.
Example:
Input: grid = [[1,3,1],[1,5,1],[4,2,1]]
Output: 7

Hints from issue discussion:
Please assign me this issue. I am a good programmer and a beginner at open source. I would give it my best!
Please assign me this issue. I want to take my first steps towards contributing in open-source.
Hello please assigne me this issue.I am  a beginner at open source and want to hone my skills.
`I can do this! please assign me this issue`
I can complete this Pythagoras Generator, Please assign this to me
I am new to opensource and I am willing to learn and contribute.

Commit message: added description to minimum_path_sum

Patch to review:
diff --git a/graphs/minimum_path_sum.py b/graphs/minimum_path_sum.py
new file mode 100644
index 000000000000..faf104c2e107
--- /dev/null
+++ b/graphs/minimum_path_sum.py
@@ -0,0 +1,60 @@
+def min_path(grid):
+
+    """
+    Find the path from top left to bottom right of array of numbers
+    with the lowest possible sum and return the sum along this path.
+    >>> min_path([
+    ...     [1, 3, 1],
+    ...     [1, 5, 1],
+    ...     [4, 2, 1],
+    ... ])
+    7
+
+    >>> min_path([
+    ...     [1, 0, 5, 6, 7],
+    ...     [8, 9, 0, 4, 2],
+    ...     [4, 4, 4, 5, 1],
+    ...     [9, 6, 3, 1, 0],
+    ...     [8, 4, 3, 2, 7],
+    ... ])
+    20
+
+    >>> min_path(None)
+    Traceback (most recent call last):
+        ...
+    TypeError: The grid does not contain the appropriate information
+
+    >>> min_path([[]])
+    Traceback (most recent call last):
+        ...
+    TypeError: The grid does not contain the appropriate information
+    """
+
+    if not grid or not grid[0]:
+        raise TypeError("The grid does not contain the appropriate information")
+
+    for cell_n in range(1, len(grid[0])):
+        grid[0][cell_n] += grid[0][cell_n - 1]
+    row_above = grid[0]
+
+    for row_n in range(1, len(grid)):
+        current_row = grid[row_n]
+        grid[row_n] = fill_row(current_row, row_above)
+        row_above = grid[row_n]
+
+    return grid[-1][-1]
+
+
+def fill_row(current_row, row_above):
+
+    current_row[0] += row_above[0]
+    for cell_n in range(1, len(current_row)):
+        current_row[cell_n] += min(current_row[cell_n - 1], row_above[cell_n])
+
+    return current_row
+
+
+if __name__ == "__main__":
+    import doctest
+
+    doctest.testmod()


Code review comments:
diff_hunk: @@ -0,0 +1,60 @@
+def min_path(grid):
path: graphs/minimum_path_sum.py
text: @unknown:
Please provide return type hint for the function: `min_path`. **If the function does not return a value, please provide the type hint as:** `def function() -> None:`

Please provide type hint for the parameter: `grid`

diff_hunk: @@ -0,0 +1,60 @@
+def min_path(grid):
+
+    """
+    Find the path from top left to bottom right of array of numbers
+    with the lowest possible sum and return the sum along this path.
+    >>> min_path([
+    ...     [1, 3, 1],
+    ...     [1, 5, 1],
+    ...     [4, 2, 1],
+    ... ])
+    7
+
+    >>> min_path([
+    ...     [1, 0, 5, 6, 7],
+    ...     [8, 9, 0, 4, 2],
+    ...     [4, 4, 4, 5, 1],
+    ...     [9, 6, 3, 1, 0],
+    ...     [8, 4, 3, 2, 7],
+    ... ])
+    20
+
+    >>> min_path(None)
+    Traceback (most recent call last):
+        ...
+    TypeError: The grid does not contain the appropriate information
+
+    >>> min_path([[]])
+    Traceback (most recent call last):
+        ...
+    TypeError: The grid does not contain the appropriate information
+    """
+
+    if not grid or not grid[0]:
+        raise TypeError("The grid does not contain the appropriate information")
+
+    for cell_n in range(1, len(grid[0])):
+        grid[0][cell_n] += grid[0][cell_n - 1]
+    row_above = grid[0]
+
+    for row_n in range(1, len(grid)):
+        current_row = grid[row_n]
+        grid[row_n] = fill_row(current_row, row_above)
+        row_above = grid[row_n]
+
+    return grid[-1][-1]
+
+
+def fill_row(current_row, row_above):
path: graphs/minimum_path_sum.py
text: @unknown:
As there is no test file in this pull request nor any test function or class in the file `graphs/minimum_path_sum.py`, please provide doctest for the function `fill_row`

Please provide return type hint for the function: `fill_row`. **If the function does not return a value, please provide the type hint as:** `def function() -> None:`

Please provide type hint for the parameter: `current_row`

Please provide type hint for the parameter: `row_above`