Koko Eating Bananas - Leetcode 875 - Binary Search (Python)

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025

Комментарии • 23

  • @GregHogg
    @GregHogg  5 месяцев назад +2

    Master Data Structures & Algorithms For FREE at AlgoMap.io!

  • @servantofthelord8147
    @servantofthelord8147 4 месяца назад +5

    I’ve said it before and I’ll say it again - you are such a gifted teacher!

    • @GregHogg
      @GregHogg  4 месяца назад +2

      Thank you so much!!

  • @BananaButcher
    @BananaButcher 22 дня назад +1

    O my god! this is amazing . thank you sir. I have watch 2 videos before even tried myself . After watching this I successfully understand it.

  • @ParthPatel-xb2cn
    @ParthPatel-xb2cn Месяц назад +1

    def koko(eating_capacity):
    if eating_capacity 1000:
    return "Koko has transcended to MONSTER status"
    else:
    return "Koko is... in a mysterious state”

  • @ramineye6498
    @ramineye6498 3 дня назад

    koko is overthinking this, just eat and be happy and leave us out of it

  • @Johnson_Amah
    @Johnson_Amah 3 месяца назад +1

    Hey Greg. I found that l

  • @zhihangcheng1083
    @zhihangcheng1083 4 месяца назад

    Hello, I’ve recently started learning binary search and have encountered several challenges. I often struggle with deciding whether to use while l

  • @younis533
    @younis533 6 месяцев назад +1

    I would have liked and illustrated explanation to the tech you used at the end, also wouldnt checking if a k works then checking k-1 doesnt work then that k is my answer

  • @christianjt7018
    @christianjt7018 5 месяцев назад

    Amazing solution! thanks for sharing

  • @zhihangcheng1083
    @zhihangcheng1083 4 месяца назад

    Great video! But I believe that the slowest speed could be optimized to math.ceil(sum(piles) / h), not 1

  • @SeanKearney-g7d
    @SeanKearney-g7d 3 месяца назад

    god dam you killed this Greg

  • @FaberLSH
    @FaberLSH 6 месяцев назад

    Thank you so much!

  • @xiranli3239
    @xiranli3239 6 месяцев назад

    You are amazing❤

    • @GregHogg
      @GregHogg  6 месяцев назад

      Thank you!

  • @lakshyamathur8808
    @lakshyamathur8808 10 месяцев назад

    what does the function k_works return??
    what is meant by if k_works(k) ??

    • @GregHogg
      @GregHogg  6 месяцев назад +2

      True if k works, false otherwise

    • @moonlight-td8ed
      @moonlight-td8ed 5 месяцев назад +1

      it return True if monkey can eat k number of bananas in a pile in time

  • @mumuuheibjf
    @mumuuheibjf 2 месяца назад

    while solving this problem I am craving bananas 🤣

  • @DivineEdoka
    @DivineEdoka 3 месяца назад

    My question is why is binary search working even when the arrray is unsorted

    • @GregHogg
      @GregHogg  3 месяца назад +2

      We're not binary searching the array, we're searching the space for k