solves the N queens problem - how to place N queens on an NxN chess board so they do not attack each other