comefrom: <doocs>2007.Find Original Array From Doubled Array_1.py
code: def findOriginalArray( changed: List[int]) -> List[int]:
      if len(changed) % 2 != 0:
          return []
      n = 100010
      counter = [0] * n
      for x in changed:
          counter[x] += 1
      if counter[0] % 2 != 0:
          return []
      res = [0] * (counter[0] // 2)
      for i in range(1, n):
          if counter[i] == 0:
              continue
          if i * 2 > n or counter[i] > counter[i * 2]:
              return []
          res.extend([i] * counter[i])
          counter[i * 2] -= counter[i]
      return res
masked: def sample_funcname ( var_0 : List [ int ] ) -> List [ int ] :
      if len ( var_0 ) % 2 != 0 :
          return [ ]
      var_1 = 100010
      var_2 = [ 0 ] * var_1
      for var_3 in var_0 :
          var_2 [ var_3 ] += 1
      if var_2 [ 0 ] % 2 != 0 :
          return [ ]
      var_4 = [ 0 ] * ( var_2 [ 0 ] // 2 )
      for var_5 in range ( 1 , var_1 ) :
          if var_2 [ var_5 ] == 0 :
              continue
          if var_5 * 2 > var_1 or var_2 [ var_5 ] > var_2 [ var_5 * 2 ] :
              return [ ]
          var_4.extend ( [ var_5 ] * var_2 [ var_5 ] )
          var_2 [ var_5 * 2 ] -= var_2 [ var_5 ]
      return var_4
  