{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "0d48d2626c8148519dfce95b56830925",
  "keywords": "数学,动态规划,组合数学",
  "title": "不同路径",
  "desc": [
    {
      "content": "\n<p>一个机器人位于一个 <code>m x n</code><em> </em>网格的左上角 （起始点在下图中标记为 “Start” ）。</p>\n<p>机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角（在下图中标记为 “Finish” ）。</p>\n<p>问总共有多少条不同的路径？</p>\n<p> </p>\n<p><strong>示例 1：</strong></p><img\nsrc=\"https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0062.Unique%20Paths/images/robot_maze.png\" />\n<pre><strong>输入：</strong>m = 3, n = 7<strong><br />输出：</strong>28</pre>\n<p><strong>示例 2：</strong></p>\n<pre><strong>输入：</strong>m = 3, n = 2<strong><br />输出：</strong>3<strong><br />解释：</strong>从左上角开始，总共有 3 条路径可以到达右下角。<br />1. 向右 -> 向下 -> 向下<br />2. 向下 -> 向下 -> 向右<br />3. 向下 -> 向右 -> 向下</pre>\n<p><strong>示例 3：</strong></p>\n<pre><strong>输入：</strong>m = 7, n = 3<strong><br />输出：</strong>28</pre>\n<p><strong>示例 4：</strong></p>\n<pre><strong>输入：</strong>m = 3, n = 3<strong><br />输出：</strong>6</pre>\n<p> </p>\n<p><strong>提示：</strong></p>\n<ul>\n<li><code>1 <= m, n <= 100</code></li>\n<li>题目数据保证答案小于等于 <code>2 * 10<sup>9</sup></code></li>\n</ul>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "java"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ]
  ],
  "template": {
    "content": "class Solution {\n\tpublic int uniquePaths(int m, int n) {\n\t\tint[][] route = new int[m][n];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tif (i == 0 || j == 0) {\n\t\t\t\t\troute[i][j] = 1;\n\t\t\t\t} else {\n\t\t\t\t\troute[i][j] = route[i - 1][j] + route[i][j - 1];\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn route[m - 1][n - 1];\n\t}\n}\n",
    "language": "java"
  },
  "node_id": "dailycode-21945d925ace44438887c1e03e5fa8ca",
  "license": "csdn.net",
  "created_at": 1637894159,
  "topic_link": "https://bbs.csdn.net/topics/600469822"
}