input: def gini(x):
      """Calculate Gini Coefficient of a given dataset.
      Example:
      >>> gini(np.array([2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,21]))
      0.605
      """
output:     unique_values, counts = np.unique(x, return_counts=True)
      total_count = len(x)
      gini_sum = 0
      for count in counts:
          gini_sum += (count / total_count) ** 2
      return 1 - gini_sum