input: Write a Python function to determine if the number of inversions of two different types is equal or not.
  assert solve([1,0,2],3) == True
  assert solve([1,2,0],3) == False
  assert solve([1,2,1],3) == True
output: def solve(a,n):
      inversions1 = inversions2 = 0
      
      for i in range(n):
          for j in range(i + 1, n):
              if a[i] == 1 and a[j] == 0:
                  inversions1 += 1
              elif a[i] == 2 and a[j] == 1:
                  inversions2 += 1
      
      return inversions1 == inversions2