<doocs>0645.Set Mismatch_1.py
def findErrorNums( nums: List[int]) -> List[int]:
    eor, n = 0, len(nums)
    for i in range(1, n + 1):
        eor ^= i ^ nums[i - 1]
    diff = eor & (~eor + 1)
    a = 0
    for i in range(1, n + 1):
        if (nums[i - 1] & diff) == 0:
            a ^= nums[i - 1]
        if (i & diff) == 0:
            a ^= i
    b = eor ^ a
    for num in nums:
        if a == num:
            return [a, b]
    return [b, a]
def sample_funcname ( var_0 : List [ int ] ) -> List [ int ] :
    var_4 , var_6 = 0 , len ( var_0 )
    for var_9 in range ( 1 , var_6 + 1 ) :
        var_4 ^= var_9 ^ var_0 [ var_9 - 1 ]
    var_10 = var_4 & ( ~ var_4 + 1 )
    var_11 = 0
    for var_9 in range ( 1 , var_6 + 1 ) :
        if ( var_0 [ var_9 - 1 ] & var_10 ) == 0 :
            var_11 ^= var_0 [ var_9 - 1 ]
        if ( var_9 & var_10 ) == 0 :
            var_11 ^= var_9
    var_12 = var_4 ^ var_11
    for var_13 in var_0 :
        if var_11 == var_13 :
            return [ var_11 , var_12 ]
    return [ var_12 , var_11 ]
