leetcode 63. Unique Paths II
来源:互联网 发布:mac画网络拓扑图 编辑:程序博客网 时间:2024/06/07 22:24
class Solution {public:int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid){int a[101][101]{};int m = obstacleGrid.size();int n = obstacleGrid[0].size();for (int i = 1; i <= n; i++){if (obstacleGrid[0][i - 1] == 1){break;}a[1][i] = 1;}for (int i = 1; i <= m; i++){if (obstacleGrid[i - 1][0] == 1){break;}a[i][1] = 1;}for (int i = 2; i <= m; i++){for (int j = 2; j <= n; j++){if (obstacleGrid[i - 1][j - 1] == 0){a[i][j] = a[i - 1][j] + a[i][j - 1];}}}return a[m][n];}};
0 0
- LeetCode --- 63. Unique Paths II
- LeetCode 63.Unique Paths II
- [leetcode] 63.Unique Paths II
- [leetcode] 63.Unique Paths II
- Leetcode 63. Unique Paths II
- LeetCode 63. Unique Paths II
- [leetcode] 63. Unique Paths II
- leetcode 63. Unique Paths II
- 63. Unique Paths II LeetCode
- LeetCode 63. Unique Paths II
- [LeetCode]63. Unique Paths II
- leetcode 63. Unique Paths II
- LeetCode *** 63. Unique Paths II
- leetcode 63. Unique Paths II
- Leetcode:63. Unique Paths II
- LeetCode 63. Unique Paths II
- leetcode 63.Unique Paths II
- LeetCode 63. Unique Paths II
- pwnable.kr-random-Writeup
- Windows Server 2003 IIS6.0+PHP5(FastCGI)+MySQL5环境搭建教程
- 求二叉树的层次遍历
- ubuntu apt-get 安装的路径
- python3 小知识点
- leetcode 63. Unique Paths II
- MySQL重要概念图解(重要)
- notes Windows Batch Scripting wiki
- Phabricator
- 111. Minimum Depth of Binary Tree
- 数据结构实验之求二叉树后序遍历和层次遍历
- spring boot(一):入门篇
- MongoDB3.2磁盘碎片整理---compact详述
- 数据结构实验之二叉树三:统计叶子数