ByteByteGo logo
menuProblems List

N Queens

Hard

There is a chessboard of size n x n. Your goal is to place n queens on the board such that no two queens attack each other. Return the number of distinct configurations where this is possible.

Example:

Input: n = 4
Output: 2

You can practice coding exercises online by logging into bytebytego.com on your laptop.