How do you figure out how much to shrink the window by? Sometimes I have trouble figuring out if whether I shrink it by 1 (i.e L += 1) or shrink it further.
you kind of use a loop that would continuously until a certain condition is met. at least that's what I observed in the sliding window problems I solved.
I am going to remember this better by calling it the 'caterpillar problem' because it reminds me of how a caterpillar moves (first moves head than butt)
that two pointers insight is such a key, i used to struggle with these questions until I discovered it.
Thanks
Glad it was helpful!
How do you figure out how much to shrink the window by?
Sometimes I have trouble figuring out if whether I shrink it by 1 (i.e L += 1) or shrink it further.
you kind of use a loop that would continuously until a certain condition is met. at least that's what I observed in the sliding window problems I solved.
I am going to remember this better by calling it the 'caterpillar problem' because it reminds me of how a caterpillar moves (first moves head than butt)
haha never knew caterpillars move like that but that works
Sir do more vedios on faang and how to get into companies
I plan to make a whole series on different patterns you need to pass faang interviews!
Thank you!
Of course happy to help!
Sir do you earn 200000 dollars a year? Plz reply. Thanks a lot.
Unfortunately not yet haha, but I've been close...
@@austinlee_inc interesting.