title: Count Index Pairs Equal Elements Array
signature: count_index_pairs_equal_elements_array <- function(arr, n) {
source_py: def count_index_pairs_equal_elements_array(arr, n):
      ans = 0
      for i in range(0, n):
          for j in range((i + 1), n):
              if (arr[i] == arr[j]):
                  ans += 1
      return ans
source_cpp: int count_index_pairs_equal_elements_array(vector<int> arr, int n) {
    int ans = 0;
    for ( int i = 0;
    i < n;
    i ++ ) for ( int j = i + 1;
    j < n;
    j ++ ) if ( arr [ i ] == arr [ j ] ) ans ++;
    return ans;
  }