You are viewing a single comment's thread. Return to all comments →
function divisibleSumPairs(n, k, ar) { let sum=0,count=0,i,j; for(i=0; i<n; i++){ for(j=i+1; j<n; j++){ sum=ar[i]+ar[j]; if(sum%k==0){ count++; } } } return count; }
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 →