N-Queens II
Try to solve the N-Queens II problem.
We'll cover the following
Statement
Given an integer, n
, representing the size of an n x n
chessboard, return the number of distinct ways to place n
queens so that no two queens attack each other. A queen can attack another queen if they are in the same row, column, or diagonal.
Constraints:
n
Examples
Create a free account to view this lesson.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy