Skip to content

Commit

Permalink
第51题.N皇后 修改Java代码
Browse files Browse the repository at this point in the history
  • Loading branch information
posper98 committed Aug 26, 2021
1 parent 5a467c2 commit e419a5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/0051.N皇后.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class Solution {

public boolean isValid(int row, int col, int n, char[][] chessboard) {
// 检查列
for (int i=0; i<n; ++i) {
for (int i=0; i<row; ++i) { // 相当于剪枝
if (chessboard[i][col] == 'Q') {
return false;
}
Expand Down

0 comments on commit e419a5f

Please sign in to comment.