Tap here to switch tabs
Problem
Submissions

Problem: N-Queens II

N-Queens II asks for the number of distinct arrangements of n queens on an n by n chessboard, with no two queens sharing a row, column, or diagonal.

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:

  • 1≤1 \leq n ≤9\leq 9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: N-Queens II

N-Queens II asks for the number of distinct arrangements of n queens on an n by n chessboard, with no two queens sharing a row, column, or diagonal.

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:

  • 1≤1 \leq n ≤9\leq 9