• + 0 comments

    This is my solution, with JavaScript:

    function divisibleSumPairs(n, k, ar) {
        // Write your code here
        let count = 0;
        while(ar.length>1){
            let i = ar.shift();
            for(let j=0; j<ar.length;j++){    
            let sum = i + ar[j];
            if(sum%k===0) count++;
            }
        }
        return count;
    }