educative.io

Same Big-O as Brute Force

If the brute force method of having 3 for-loops through the array is O(N^3), why would using pointers be a better solution if it too evaluates to O(N^3)?

The two pointers approach takes O(N^2) and not O(N^3). Probably, you are confusing it with the second problem discussed at the end.