第51题.N皇后 修改Java代码

This commit is contained in:
xsduan98
2021-08-26 10:29:54 +08:00
parent 5a467c2d93
commit e419a5f908

View File

@ -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;
}