Number of Subarrays with Bounded Maximum | Leetcode 795 | Live coding session

preview_player
Показать описание
Here is the solution to "Number of Subarrays with Bounded Maximum" leetcode question. Hope you have a great time going through it.

Chapters
1) 0:00 Explaining the problem out loud
2) 1:10 Question walkthrough
3) 2:00 Approach
4) 4:00 Algo development
5) 12:00 Coding it up

For discussion/feedback

PS : Please increase the speed to 1.25X
Рекомендации по теме
Комментарии
Автор

The way you approach problem is good !!
Like Previously Priority Queue one and now this sliding window one !!
Respect++

adarshsharmanit
Автор

Good explanation, also we don't need this condition . you can minimize the if block from the code base
//if (nums[end] < left)
//{
// window = 0;
//}

Vivekjoshi
Автор

Nice explanation with examples and algo building. I coded after your explanation. Thanks.

glenfernandes
Автор

With the practice of such logic building questions can any one get the optimal solution within 2-3 attempts??By the way very good explanation, Thank you..

manikantasai
Автор

hey, thanks for explaining, this question is kinda tricky to implement it optimally....i faced issue doing this...

subhamtripathi
Автор

Wow! Actually it's quite tricky while implementating it but while putting your code in mind, I was able to figure out all possible cases & scenarios which were giving correct answers as per your code. So, I can say that approaching problem through code was bit tricky as compared to approaching problem through test cases.
Nice approach! Would be glad to know your way of approaching problems.

amazinglife
Автор

Nice one, good explanation, made it very simple to understand.
But the line
windowCount = windowCount
doesn't make any sense

alainatoyreview
Автор

I think there is no necessity of line 22

arnabpersonal
join shbcf.ru