Non-overlapping Intervals II Greedy II DP II Binary Search II Leetcode 435

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

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

  • @ARYANMITTAL
    @ARYANMITTAL  Год назад +7

    No Matter, if you have solved it or not, or even watched any other video, I'll highly recommend to watch the video entirely !! ❤
    Checkout DSA-169 Series: ruclips.net/video/5BuKVS-Vnws/видео.html
    Problem Link: leetcode.com/problems/non-overlapping-intervals/description/
    Code & Notes: drive.google.com/file/d/1H47g4O1yswIqjkaxRTgNpkIgAHGNZ3CT/view?usp=sharing

  • @tejuschaturvedi6234
    @tejuschaturvedi6234 Год назад +7

    He literally wrote BUT BUT BUT ( Hold your Horses ) in the notes . OP😂🔥

  • @gouthamp9066
    @gouthamp9066 Год назад +9

    Bro just quit your job and start teaching and start a start-up bro for sure, sure you will build a big company trust me your way of explanation is next level❤‍🔥

    • @RishabhSingh-xn3xu
      @RishabhSingh-xn3xu Год назад

      there are 100's of people doing the same thing and only 3 or 4 are successful, and he is not getting enough views already therefore he can't compete with giants.

  • @UECAshutoshKumar
    @UECAshutoshKumar 5 месяцев назад +1

    Thank you 😊

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

    Awesome explanation man !!

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

    good explanation!

  • @sauravchandra10
    @sauravchandra10 Год назад +3

    I have solved this problem before, but the intuition was never so clearer.
    One request, I found it hard to understand the better approach O(NlogN). If you could explain it, it would have been better

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

    Thank you again for another great video!

  • @nadeking1530
    @nadeking1530 Год назад +4

    why sort according to end times, i did it with same logic and just did it with start times, and i only passed some test cases

    • @phoenix_1_3
      @phoenix_1_3 Год назад

      Also works when we sort with starting time

    • @bentenison3409
      @bentenison3409 Год назад

      @@phoenix_1_3 send your code bro

    • @sauravchandra10
      @sauravchandra10 Год назад +2

      @@phoenix_1_3 No, it does not

    • @sauravchandra10
      @sauravchandra10 Год назад +1

      The reason behind sorting according to end time so that we can get those intervals which end first before and hence maximise the number of intervals, or in other words, minimise the no of erases.
      For eg: consider an interval 1,10 2,3 3,4 4,5 5,6 6,7 7,8
      If we sort according to starting time, we would include 1,10 which would invariably prevent us from taking 2,3 3,4 4,5 5,6 6,7 7,8

    • @phoenix_1_3
      @phoenix_1_3 Год назад

      @@bentenison3409
      class Solution {
      public:
      int eraseOverlapIntervals(vector& intervals) {
      sort(begin(intervals), end(intervals));
      int res = 0, n = size(intervals);
      int prev = INT_MIN;
      for(auto &i : intervals){
      if(i[0] < prev) {
      res++;
      prev = min(prev, i[1]);
      }
      else prev = i[1];
      }
      return res;
      }
      };

  • @kamla2620
    @kamla2620 Год назад

    Please make a Bit manipulation playlist

  • @kirteeprajapati2076
    @kirteeprajapati2076 Год назад

    trying to come close just like situationship .