Remove the current element A [ i ] from the queue and set .
if ( A [ i ] == q . queue [ 0 ] ) : NEW_LINE INDENT q . get ( ) NEW_LINE s . remove ( A [ i ] ) NEW_LINE DEDENT if ( q . qsize ( ) == 0 ) : NEW_LINE INDENT break NEW_LINE DEDENT