The solution states… ‘each of the iteration takes O(n) time…’
Its clear that this is a linear time algorithm. However, to be more rigorous, isn’t each iteration doing better than O(n)? Since in each for loop, we are not checking each and every value in the string, we are actually jumping indices.
Thoughts?