def queens_solved(organisms):
    """Determine if we have solved the problem.

    We just search through the population for an organism that has a
    fitness that is equal to the number of queens in the population.
    If so, we have a solution, otherwise we need to keep looking.
    """
    for org in organisms:
        if org.fitness == len(org.genome):
            return 1

    # if we got here we didn't do it
    return 0