Closed
Description
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 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.
Metadata
Metadata
Assignees
Labels
No labels