def divisibleSumPairs(n, k, ar):
# Write your code here
# i < j
cnt = 0
for head in range(len(ar)):
tail = head + 1
while tail < n:
if (ar[head] + ar[tail]) % k == 0:
cnt += 1
tail += 1
return cnt
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Day of the Programmer (0) | 2022.07.03 |
---|---|
[HackerRank-python] Migratory Birds (0) | 2022.07.03 |
[HackerRank-python] Subarray Division (0) | 2022.07.03 |
[HackerRank-python] Breaking the Records (0) | 2022.07.02 |
[HackerRank-python] Between Two Sets (0) | 2022.07.02 |