input: Write a python function to check whether the count of inversion of two types are same 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(arr, n):
      type1 = 0
      type2 = 0
      for i in range(n):
          for j in range(i+1, n):
              if arr[i] > arr[j]:
                  if arr[i] == 1 and arr[j] == 0:
                      type1 += 1
                  elif arr[i] == 2 and arr[j] == 1:
                      type2 += 1
      return type1 == type2