We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99cf7d7 commit 64f8d7aCopy full SHA for 64f8d7a
1 file changed
divisiblesumpairs.py
@@ -0,0 +1,16 @@
1
+def divisibleSumPairs(n, k, ar):
2
+ count = 0
3
+ for i in range(0,n):
4
+
5
+ # (i>j)
6
+ for j in range(i+1,n):
7
+ if((ar[i]+ar[j])%k==0):
8
+ count+=1
9
10
+ return count
11
12
+# Complete the divisibleSumPairs function in the editor below. It should return the integer count of pairs meeting the criteria.
13
+# divisibleSumPairs has the following parameter(s):
14
+# n: the integer length of array
15
+# ar: an array of integers
16
+# k: the integer to divide the pair sum by
0 commit comments