https://leetcode.com/problems/koko-eating-bananas/description/

https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold/description/


위에 두문제 이분탐색으로 풀었고



find-the-smallest-divisor-given-a-threshold

https://ideone.com/1sN0u3


koko-eating-bananas

https://ideone.com/yd4u08




이분탐색 핵심로직은 거의 문제인데


1.

while문에 들어갈 조건이

<= 이냐 < 가 다르고


2.

피봇값(미들값)으로 설정하는데

right = mid + 1

하고

right = mid

가 다른데


혹시 이유 아는사람 ..


이거때문에 굉장히 헷갈림..