LeetCode
N-Queens
Click
here
for an explanation.