def queens_solved(organisms):
 for org in organisms:
  if (org.fitness == len(org.genome)):
   return 1
 return 0

def queens_solved ( organisms ) : for org in organisms : if ( org . fitness == len ( org . genome ) ) : return 1 return 0
determine if we have solved the problem .