Shouldnt the complexity be greater than O(n)

We are running one outer loop n times and the while loop inside runs till the right bound is not found but i still has to complete n iterations.