Merge pull request #657 from xsduan98/master

第51题.N皇后 修改Java代码
This commit is contained in:
程序员Carl
2021-08-26 15:25:52 +08:00
committed by GitHub

View File

@ -341,7 +341,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;
}