Set current queen as the attacker
attackers [ 5 ] = queens [ i ] NEW_LINE for i in range ( 8 ) : NEW_LINE f = 1 NEW_LINE for x in attackers [ i ] : NEW_LINE if x != 0 : NEW_LINE f = 0 NEW_LINE break NEW_LINE if f == 0 : NEW_LINE sol . append ( attackers [ i ] ) NEW_LINE