Maintain the same semantics as other languages in n_queens.go (#1329)

This commit is contained in:
huangjikun 2024-05-03 19:40:59 +08:00 committed by GitHub
parent d2d49551e3
commit ee67d3e6a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ func backtrack(row, n int, state *[][]string, res *[][][]string, cols, diags1, d
} }
*res = append(*res, newState) *res = append(*res, newState)
return
} }
// 遍历所有列 // 遍历所有列
for col := 0; col < n; col++ { for col := 0; col < n; col++ {