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

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024
  • In this video, I'll talk about how to solve Leetcode 3113. Find the Number of Subarrays Where Boundary Elements Are Maximum | Binary Search | Monotonic Stack trick
    PBDS (Policy Based Data - structure) - • 3072. Distribute Eleme...
    Monotonic Stack Tricks (shortcut to write & remember code) - • 85. Maximal Rectangle ...
    Let's Connect:
    📱Discord (Join Community) : / discord
    📝Linkedin: / aryan-mittal-0077
    📸 Instagram: / ez.pz.dsa
    💻 Twitter - / aryan_mittal007
    🤖 Github: github.com/ary...
    About Me:
    I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
    ✨ Timelines✨
    ✨ Hashtags ✨
    #programming #Interviews #leetcode #faang #maang #datastructures #algorithms

ความคิดเห็น • 16

  • @ARYANMITTAL
    @ARYANMITTAL  5 หลายเดือนก่อน +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 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 .

    • @sanketchugh294
      @sanketchugh294 5 หลายเดือนก่อน

      @@abiraljain7313 Where did you learn segment tree from?

  • @abiraljain7313
    @abiraljain7313 5 หลายเดือนก่อน +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 . 🤔🤔

    • @sakshammisra189
      @sakshammisra189 2 หลายเดือนก่อน

      agar pass hogya toh kr hi skte hai

  • @paragroy5359
    @paragroy5359 4 หลายเดือนก่อน

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

  • @vikaspatel2834
    @vikaspatel2834 5 หลายเดือนก่อน

    How does logic become so great so quickly ❤

  • @LogicArena01
    @LogicArena01 5 หลายเดือนก่อน

    Thanks for the clear and concise explanation ❤

  • @Xzist2382
    @Xzist2382 5 หลายเดือนก่อน

    Good explanation bro

  • @manishgaming4638
    @manishgaming4638 5 หลายเดือนก่อน +1

    Today contest was very easy

    • @idiomz4104
      @idiomz4104 5 หลายเดือนก่อน

      you must have ranked in the top 100 then, stfu

  • @ayaaniqbal3531
    @ayaaniqbal3531 5 หลายเดือนก่อน

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

    • @Groza558
      @Groza558 5 หลายเดือนก่อน +1

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

    • @ayaaniqbal3531
      @ayaaniqbal3531 5 หลายเดือนก่อน

      @@Groza558 ohh okay

    • @YashMalav-kh1ov
      @YashMalav-kh1ov 5 หลายเดือนก่อน +1

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

  • @VishalKumar-dy5rk
    @VishalKumar-dy5rk 5 หลายเดือนก่อน

    It's TLE in Java 😢