We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sure. What I meant is that even if you skip all 'j' values less than or equal to 'i', you will still have an O(n^2) time algorithm. In practice it will be a bit faster because you are 'skipping' some iterations, but strictly in terms of time complexity / running time, it is still the same O(n^2) time.
Cookie support is required to access HackerRank
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 →
Sure. What I meant is that even if you skip all 'j' values less than or equal to 'i', you will still have an O(n^2) time algorithm. In practice it will be a bit faster because you are 'skipping' some iterations, but strictly in terms of time complexity / running time, it is still the same O(n^2) time.