Helper Functions for N-Queens JS Study Group: Algorithms