This commit is contained in:
krahets
2023-09-02 23:53:33 +08:00
parent 503ca797b8
commit ca7b5c0ac2
12 changed files with 117 additions and 50 deletions

View File

@@ -250,7 +250,7 @@ $$
/* 最小路径和:暴力搜索 */
int minPathSumDFS(int[][] grid, int i, int j) {
// 若为左上角单元格,则终止搜索
if (i == 0 && j == 0){
if (i == 0 && j == 0) {
return grid[0][0];
}
// 若行列索引越界,则返回 +∞ 代价