Programming assignment 2: N queens solver using stack