why showing wrong output
ques-https://leetcode.com/problems/find-smallest-letter-greater-than-target/
ans-https://leetcode.com/submissions/detail/339673002/
please help
why showing wrong output
ques-https://leetcode.com/problems/find-smallest-letter-greater-than-target/
ans-https://leetcode.com/submissions/detail/339673002/
please help
@hunt
can u pls share ur code again. this link is not opening
https://leetcode.com/submissions/detail/339673002/ ](https://leetcode.com/submissions/detail/339673002/)
@hunt
we r using dis condition letters[e]>target in order to stop or while loop when let[e] becomes smaller than or equal to target the target.
u will see that we are using
ans=mid;
e=mid-1;
in else, hence when let[e] becomes<=target, we would have stored the greater element in ans.
hope dis helps.