You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
Not necessarily a bug, more of an optimization for clarity of the code. The line res = r after the line l, r = 1, max(piles) is unnecessary, and I believe it was left over from the solution given in the video.
In the video, the solution involved updating res as res = min(res, k). However, this was also unnecessary, as it was always true that k < res due to the nature of binary search. Because this was unnecessary, the line res = r above also becomes unnecessary.
The text was updated successfully, but these errors were encountered:
Bug Report for https://neetcode.io/problems/eating-bananas
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
Not necessarily a bug, more of an optimization for clarity of the code. The line
res = r
after the linel, r = 1, max(piles)
is unnecessary, and I believe it was left over from the solution given in the video.In the video, the solution involved updating
res
asres = min(res, k)
. However, this was also unnecessary, as it was always true thatk < res
due to the nature of binary search. Because this was unnecessary, the lineres = r
above also becomes unnecessary.The text was updated successfully, but these errors were encountered: