In the explantation, it was derived that a nested loop with index modification (e.g., outer loop increments the i value by i*2) may have up to O(n) complexity. When I tried executing the code, the total runtime count of outer + inner loop is definitely more than O(n).
Outer loop ~ log(n)
Inner loop ~ (log (n) ) . n
To me, it almost looks like this algorithm is having O(nlog(n)) complexity. Please correct me if I’m wrong.