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