parameters: (self, stones)
return_statement: return len(stones) - len({find(x) for x in UF})
docstring: :type stones: List[List[int]]
          :rtype: int
docstring_summary: :type stones: List[List[int]]
          :rtype: int
docstring_tokens: : type stones : List [ List [ int ]] : rtype : int
function: def removeStones(self, stones):
          """
          :type stones: List[List[int]]
          :rtype: int
          """
          UF = {}
          def find(x):
              if x != UF[x]:
                  UF[x] = find(UF[x])
              return UF[x]
          
          def union(x, y):
              UF.setdefault(x, x)
              UF.setdefault(y, y)
              UF[find(x)] = find(y)
  
          for i, j in stones:
              union(i, ~j)
          return len(stones) - len({find(x) for x in UF})
function_tokens: def removeStones ( self , stones ) : UF = { } def find ( x ) : if x != UF [ x ] : UF [ x ] = find ( UF [ x ] ) return UF [ x ] def union ( x , y ) : UF . setdefault ( x , x ) UF . setdefault ( y , y ) UF [ find ( x ) ] = find ( y ) for i , j in stones : union ( i , ~ j ) return len ( stones ) - len ( { find ( x ) for x in UF } )