A genetic algorithm approach to solving the n Queens problem