LeetCode
N-Queens II
Click
here
for an explanation.