Thank you for watching the video! You can find a long-form explanation to this problem in the related video section (bottom left corner of the screen). Subscribe if you want to see these in your feed daily!
GregHogg
Dude getting jacked from bench pressing all these algorithms
dukeray
programmers after thousand leetcode questions for real
creatively
This question wasn't too tough, but I could not for the life of me figure out the logic behind contracting the window until it became valid. Your vid saved me lol
eric
We're gonna need that workout routine greg😂😂
ForexPeak
We can replace While() with simple if() by these the time complexity from O(n+n) to O(n). By replacing with if we are resisting the window from decreasing it size from the current maximum size.
prathamgolwala
Damn, he's jacked
time.sleep() build
Harmxn
Just solved this yesterday and now this video comes in my feed
Om-idqr
Master Data Structures & Algorithms For FREE at AlgoMap.io!
GregHogg
When you're bench pressing the window instead of sliding the window.
MagnumCarta
Can we use prefix sum to solve this? Compute the consecutive 1s and 0s then loop through it using sliding window
nagisa
Woah, you’re actually pretty jacked and beefy okay then
servantofthelord
i'm still a beginner at python. my version of sliding window was similar but a little different than yours. I got a time of 408ms on leetcode but it says 16% of submissions got better performance times. What can be done with either the python language or the algorithm to speed this up?
mazthespaz
O(n) i dont get it there are 2 loops, sure there is a condition for while but when it's true it would take O(n^2) right?
anas.aldadi
for some reason my idea was keep a current max, and a total max, every time the number is 1 the count gets added to the current max, and then when it’s 0 it’s reset. Then throughout the whole way, the total max is the peak of the current max.