62. Unique Paths
来源:互联网 发布:户口本查询软件 编辑:程序博客网 时间:2024/04/28 17:51
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?
Above is a 3 x 7 grid. How many possible unique paths are there?
Note: m and n will be at most 100.
public class Solution { public int uniquePaths(int m, int n) { if (m == 0 || n == 0) { return 0; } int[][] sum = new int[m][n]; for (int i = 0; i < m; i++) { sum[i][0] = 1; } for (int i = 0; i < n; i++) { sum[0][i] = 1; } for (int i = 1; i < m; i++) { for (int j = 1; j < n; j++) { sum[i][j] = sum[i - 1][j] + sum[i][j - 1]; } } return sum[m - 1][n - 1]; }}
0 0
- 62. Unique Paths && 63. Unique Paths II
- 62. Unique Paths \ 63. Unique Paths II
- [LeetCode]62.Unique Paths
- LeetCode --- 62. Unique Paths
- LeetCode 62.Unique Paths
- [Leetcode] 62. Unique Paths
- [leetcode] 62.Unique Paths
- 62. Unique Paths
- [leetcode] 62.Unique Paths
- leetcode 62. Unique Paths
- Leetcode 62. Unique Paths
- [leetcode] 62. Unique Paths
- 62. Unique Paths LeetCode
- 62. Unique Paths
- 62. Unique Paths
- [LeetCode]62. Unique Paths
- 【LeetCOde】62. Unique Paths
- [LeetCode]62. Unique Paths
- 【腾讯Bugly干货分享】iOS 中 HTTPS 证书验证浅析
- apache beam使用spark runner
- SQL时间查询
- docker进入后台运行的容器
- 【腾讯优测干货分享】微信小程序之自动化亲密接触
- 62. Unique Paths
- c/c++ CString 转码编码解码
- stl的string的典型操作_初始化_遍历_连接_和字符指针转化_查找替换_删除_插入_常用算法
- java List复制:浅拷贝与深拷贝
- js 操作数组的方法
- 浮点数与字节数据的转换
- Java专家系列:CPU Cache与高性能编程
- 关于Objdump指令的解释
- Retrofit2.0起步篇