use ruby to solve n queen problem