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
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).
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 .
@@abiraljain7313 Where did you learn segment tree from?
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 . 🤔🤔
agar pass hogya toh kr hi skte hai
Very nice explanation, keep on making such videos.
Really helpful!!!
How does logic become so great so quickly ❤
Thanks for the clear and concise explanation ❤
Good explanation bro
Today contest was very easy
you must have ranked in the top 100 then, stfu
bro i dont know why but i was thinking of Sliding Window + ProirityQueue+HashMap approach .does this will work ?.
I applied your approach, but it failed in some test cases, then I realised sliding window won't work
@@Groza558 ohh okay
yup i applied sliding window and only 550+ test cases passed from 800
It's TLE in Java 😢