You are viewing a single comment's thread. Return to all comments →
JAVA Solution
public static int divisibleSumPairs(int n, int k, List ar) {
int count = 0; for(int i = 0; i<n; i++){ for(int j = i+1; j<n; j++){ if((ar.get(i)+ ar.get(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 →
JAVA Solution
public static int divisibleSumPairs(int n, int k, List ar) {