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; 
def count_Pairs(arr, n):
    cnt = 0
    i = 0
    while i < n:
       
        for j in range(i + 1, n):
            if arr[i] == arr[j]:
                cnt += 1
        i += 1
    return cnt