You are viewing a single comment's thread. Return to all comments →
javascript
function divisibleSumPairs(n, k, ar) { let totalPairs = 0; for (let iteration = 0; iteration < n; iteration++) { ar.forEach((element, index) => { if (index <= iteration) return; if ((ar[iteration] + element) % k === 0) totalPairs++; }); } console.info(totalPairs) return totalPairs; }
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 →
javascript