We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
/** * @param {number[][]} dp * @return {number} */ var minPathSum = function(dp) { let row = dp[0].length; let col = dp.length for(let i = 1; i < row; i++){ //第一排初始化 dp[0][i] += dp[0][i - 1] } for(let i = 1; i < col; i++){ //第一列初始化 dp[i][0] += dp[i - 1][0] } for(let i = 1; i < col; i++){ for(let j = 1; j < row; j++){ dp[i][j] += Math.min(dp[i][j - 1],dp[i - 1][j]) //注意这里是+= 左边或者上边小的那一个 } } return dp[col - 1][row - 1] };
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: