0052. N-Queens II
Last updated
Last updated
https://leetcode.com/problems/n-queens-ii
The n-queens puzzle is the problem of placing n
queens on an n x n
chessboard such that no two queens attack each other.
Given an integer n
, return the number of distinct solutions to the n-queens puzzle.
Example 1:
Example 2:
Constraints:
1 <= n <= 9
https://leetcode.com/problems/n-queens-ii/discuss/20048/Easiest-Java-Solution-(1ms-98.22)