My Calendar I | Leetcode 729

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

КОМЕНТАРІ • 8

  • @divinemoment40
    @divinemoment40 2 місяці тому

    Thank you for help, you have explained in a very simple way with worst to best approach

  • @liveurlife3166
    @liveurlife3166 2 місяці тому

    DONE AND DUSTED !

  • @krishkumar491
    @krishkumar491 2 місяці тому

    Sir, upper bound will return the next highest element so if you apply for zero then it should give 10 not 20 please tell , this point is not clear .

    • @sathishkumar-dc9ce
      @sathishkumar-dc9ce 2 місяці тому

      Hi Krish, we will be storing the end value as key and start value as value, so upper bound of 0 will be 20. When we check our condition , i,e start=0, end = 5 and map has mp[20]=10 now upper_bound(start) is 20 and end

    • @krishkumar491
      @krishkumar491 2 місяці тому

      @@sathishkumar-dc9ce Mean the upper bound will be key in every comparison then we will compare the value i.e start point with the end.

    • @techdose4u
      @techdose4u  2 місяці тому

      yes, because an interval can only start after any interval ends (0 or more)