Optimal Path Finding Questions
- Unique Path
- Unique Path II
- Minimum Path Sum
- Minimum Falling Path Sum
#
Question DescriptionOriginal Question: Leetcode 62. Unique Paths
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).
How many possible unique paths are there?
#
Example 1:#
Example 2:#
Solution- Java
- Python
#
Question DescriptionOriginal Question: Leetcode 63. Unique Paths II
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).
Now consider if some obstacles are added to the grids. How many unique paths would there be?
#
Example:#
Solution- Java
- Python
#
Question DescriptionOriginal Question: Leetcode 64. Minimum Path Sum
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.
Note: You can only move either down or right at any point in time.
#
Example:#
Solution- Java
- Python
#
Question DescriptionOriginal Question: 931. Minimum Falling Path Sum
Given a square array of integers A, we want the minimum sum of a falling path through A.
A falling path starts at any element in the first row, and chooses one element from each row. The next row's choice must be in a column that is different from the previous row's column by at most one.
#
Example:#
Solution- Java
- Python