Skip to content

Bug Report for eating-bananas #4065

Closed
Closed
@mhdadk

Description

@mhdadk

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions