You are viewing a single comment's thread. Return to all comments →
int divisibleSumPairs(int n, int k, int ar_count, int *ar) { int no = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if ((ar[i] + ar[j]) % k == 0) { no++; } } } return no; }
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 →