input: Write a method that takes an integer `limit` and a 2D list `queries`, which is an n x 2 array. 
  
  Given `limit + 1` balls labeled from 0 to `limit`, all initially uncolored, for each query in `queries` of the form [x, y], paint ball x with color y. After processing each query, determine the number of unique colors on the balls.
  
  Return a list `result` of length n, where `result[i]` indicates the count of unique colors after processing the ith query.
  
  Remember that when answering a query, colors that are not represented among the balls do not count.
  
  Examples:
  >>> limit = 4, queries = [[1, 4], [2, 5], [1, 3], [3, 4]]
  [1, 2, 2, 3]
  >>> limit = 4, queries = [[0, 1], [1, 2], [2, 2], [3, 4], [4, 5]]
  [1, 2, 2, 3, 4]
  
  Constraints:
  1 <= limit <= 10^9
  1 <= n == len(queries) <= 10^5
  queries[i].length == 2
  0 <= queries[i][0] <= limit
  1 <= queries[i][1] <= 10^9
output: def uniqueColorsAfterQueries(limit, queries):
      painted_colors = {}
      unique_colors = set()
      result = []
  
      for x, y in queries:
          if x in painted_colors:
              unique_colors.discard(painted_colors[x])
          painted_colors[x] = y
          unique_colors.add(y)
          result.append(len(unique_colors))
  
      return result