Apply DFS pattern See DFS pattern in N-Queens steps: k nums choices each step: all other numbers from 1 .. n possibility checker: next number must be greater than all selected numbers An easy DFS problem.