input: Write a python function to calculate the minimum cost of connecting points based on their y-coordinates.
  assert min_cost([(1,2), (3,1), (4,5)])==6
  assert min_cost([(0,0), (0,2), (0,4)])==4
  assert min_cost([(1,7), (2,3), (3,10)])==7
output: def min_cost(points):
      y_coords = [y for _, y in points]
      y_coords.sort()
      total_cost = 0
      for i in range(1, len(y_coords)):
          total_cost += abs(y_coords[i] - y_coords[i - 1])
      return total_cost