mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 06:51:41 +08:00
update
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 4434,
|
||||
"dislikes": 369,
|
||||
"likes": 4445,
|
||||
"dislikes": 370,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Unique Paths\", \"titleSlug\": \"unique-paths\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Unique Paths III\", \"titleSlug\": \"unique-paths-iii\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "[[0,0,0],[0,1,0],[0,0,0]]\n[[0,1],[0,0]]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"491.8K\", \"totalSubmission\": \"1.3M\", \"totalAcceptedRaw\": 491847, \"totalSubmissionRaw\": 1315755, \"acRate\": \"37.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"492.6K\", \"totalSubmission\": \"1.3M\", \"totalAcceptedRaw\": 492582, \"totalSubmissionRaw\": 1317388, \"acRate\": \"37.4%\"}",
|
||||
"hints": [
|
||||
"The robot can only move either down or right. Hence any cell in the first row can only be reached from the cell left to it. However, if any cell has an obstacle, you don't let that cell contribute to any path. So, for the first row, the number of ways will simply be \r\n\r\n<pre>\r\nif obstacleGrid[i][j] is not an obstacle\r\n obstacleGrid[i,j] = obstacleGrid[i,j - 1] \r\nelse\r\n obstacleGrid[i,j] = 0\r\n</pre>\r\n\r\nYou can do a similar processing for finding out the number of ways of reaching the cells in the first column.",
|
||||
"For any other cell, we can find out the number of ways of reaching it, by making use of the number of ways of reaching the cell directly above it and the cell to the left of it in the grid. This is because these are the only two directions from which the robot can come to the current cell.",
|
||||
|
Reference in New Issue
Block a user