返回首页
N 皇后 II
LeetCode 经典 150
回溯
难度:
困难
题目描述
计算 N 皇后的所有解决方案数量。
解题思路
使用回溯法,逐行尝试放置皇后并检查是否冲突,直到完成所有行。