We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hi here is my Python solution. I can take any suggestions .
def divisibleSumPairs(n, k, ar):
# Write your code here
count=0
for index ,i in enumerate(ar):
for index2 ,item in enumerate(ar):
if(index!=index2):
if ((i+item)%k==0):
count=count+1
print(int(count/2))
return int(count/2)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
Hi here is my Python solution. I can take any suggestions .