You are viewing a single comment's thread. Return to all comments →
Your i-loop terminates at < n-1 but your j-loop terminates at < n. Is there a possible Index out of bounds error there?
< n-1
< n
Also you could save yourself a few iterations if every j-loop started at i+1. However this would not impact the O(n^2) time complexity.
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
Your i-loop terminates at
< n-1
but your j-loop terminates at< n
. Is there a possible Index out of bounds error there?Also you could save yourself a few iterations if every j-loop started at i+1. However this would not impact the O(n^2) time complexity.