3113. Find the Number of Subarrays Where Boundary Elements Are Maximum | Binary Search | Monotonic

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

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

  • @abiraljain7313
    @abiraljain7313 6 месяцев назад +5

    Can we solve this with the segment tree to find the maximum element of the a range of i of and j . I have applied this approach is contest and it passed . Bhaiya please reply . 🤔🤔

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

    Very nice explanation, keep on making such videos.
    Really helpful!!!

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

    Thanks for the clear and concise explanation ❤

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

    How does logic become so great so quickly ❤

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

    Good explanation bro

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

    Make sure to join Discord for active Discussions during & post contest - discord.gg/5y4XTfeb
    .
    .
    If we think closely this can also be solved by only Map & only Stack too, thus resulting in most optimal time complexity to be O(n).

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

      Can we solve this with the segment tree to find the maximum element of the a range of i of and j . I have applied this approach is contest and it passed . Bhaiya please reply .

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

      @@abiraljain7313 Where did you learn segment tree from?

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

    Today contest was very easy

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

      you must have ranked in the top 100 then, stfu

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

    bro i dont know why but i was thinking of Sliding Window + ProirityQueue+HashMap approach .does this will work ?.

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

      I applied your approach, but it failed in some test cases, then I realised sliding window won't work

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

      @@Groza558 ohh okay

    • @YashMalav-kh1ov
      @YashMalav-kh1ov 6 месяцев назад +1

      yup i applied sliding window and only 550+ test cases passed from 800

  • @VishalKumar-dy5rk
    @VishalKumar-dy5rk 6 месяцев назад

    It's TLE in Java 😢