1552. Magnetic Force Between Two Balls - Day 20/30 Leetcode June Challenge

Поділитися
Вставка
  • Опубліковано 4 лис 2024

КОМЕНТАРІ • 8

  • @Algorithmist
    @Algorithmist  4 місяці тому +7

    How much space did you have between your balls?

  • @Warrior_369
    @Warrior_369 4 місяці тому +5

    Great!! Explained well. But, could you explain why did you change the limits of the binary search part at 6:47 and how do we know that we need to tweak the limits a bit??

    • @TheMustafa5233
      @TheMustafa5233 4 місяці тому +1

      as he doing it exclusive to include the value of `high` in the `mid` at line 15
      this can work both ways based on your implementation of the Binary search