You are viewing a single comment's thread. Return to all comments →
C++:
int divisibleSumPairs(int n, int k, vector<int> ar) { int count = 0; for (int i = 0; i < n; ++i) { for(int j = i; j < n; ++j) { if(j != i) { if(IsDivisiblyByK(ar[i] + ar[j], k)) { 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 →
C++: