Question: 
Write a python function to count equal element pairs from the given array.


Model's Code:
def count_Pairs(arr, n):
    from collections import Counter
    count = Counter(arr)
    pairs = 0
    for k, v in count.items():
        if v > 1:
            pairs += (v * (v - 1)) // 2
    return pairs



Sample Correct Code:
def count_Pairs(arr,n): 
    cnt = 0; 
    for i in range(n): 
        for j in range(i + 1,n): 
            if (arr[i] == arr[j]): 
                cnt += 1; 
    return cnt; 


Asserts:
assert count_Pairs([1,1,1,1],4) == 6
assert count_Pairs([1,5,1],3) == 1
assert count_Pairs([3,2,1,7,8,9],6) == 0


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 831 of 974: 637/831 (76.6546329723225%): success