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