Count pairs in array whose sum is divisible by K

The for loop in it is not exactly correct. It should be:

for i in 1:length(arr)
   for j in (i+1):length(arr)
   ...
   end
end

This question might also be better in the Usage (First Steps) rather than Development category.

1 Like