Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

public int uniquePaths(int m, int n) { int[] dp = new int[m]; dp[0] = 1; for(int i = 0; i < n; i++) for(int j = 1; j < m; j++) dp[j] = dp[j-1] + dp[j]; return dp[m-1]; }

great simplicity!

Can you explain why this gives you the solution?

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.