Test case are not passing in find upper and lower bound problem