• + 7 comments

    I did the same logic in java :)

    for(int i=0; i<n; i++){
            for(int j=1;j<n;j++){
                if (i < j){
                a = ar[i] + ar[j];
                if (a % k == 0){
                    count++;
                }}
            }
        }