N queen problem swing algorithm description