Walmart OA

Given an array of numbers [ 1 indexed ] and with an integer K.
for ex: A =[ 2 2 2 2 3 2 3 3 3 ] , k = 6
Count number of pairs such that :
1) A[i] = A[j]
2) i<j
3) ( i*j ) is divisble by k [ product of i & j ]
1< k, A[i] < 1e6

Comments (1)