Traverse set to decrease position of X for all the number removed in front
for it in removed : NEW_LINE INDENT if ( it > queries [ i ] [ 1 ] ) : NEW_LINE INDENT break NEW_LINE DEDENT position -= 1 NEW_LINE DEDENT