You are viewing a single comment's thread. Return to all comments →
What time complexity is that? Is it better than mine?
n,k = (int(x) for x in input().split()) lst = list(map(int, input().split())) count = 0 for i in range(len(lst)-1): for x in range(1+i, len(lst)): if (lst[i] + lst[x]) % k == 0: count += 1 print(count)
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
What time complexity is that? Is it better than mine?