You are viewing a single comment's thread. Return to all comments →
For those looking into Ruby:
def divisible_sum_pairs(ar_length, array, k) temp, count = [0] * k, 0 array.each do |el| count += temp[(k - el % k) % k] temp[el % k] += 1 end p count end
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 →
For those looking into Ruby: