You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
8
+
9
+
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).
10
+
11
+
How many possible unique paths are there?*/
12
+
publicclassUniquePaths {
13
+
14
+
/**Another typical DP question, use a 2d array:
15
+
* the first row and the first column need to be initialized to be 1 since there's only one way to reach every
16
+
* position in the first row and the first column: either from left or top.*/
0 commit comments