[Java] Leetcode 485/487/1004. Max Consecutive Ones I/II/III [Sliding Windows #5]

preview_player
Показать описание
In this video, I'm going to show you how to solve Leetcode 485/487/1004. Max Consecutive Ones I/II/III which is related to Sliding Windows.

Here’s a quick rundown of what you’re about to learn:

Course Contents
(0:00​) Leetcode 485
(4:22​) Leetcode 487
(13:13) Leetcode 1004

In the end, you’ll have a really good understanding on how to solve Leetcode 485/487/1004. Max Consecutive Ones I/II/III and questions that are similar to this Sliding Windows.

Now, if you want to get good at Sliding Windows, please checkout my Sliding Windows playlist.

Рекомендации по теме
Комментарии
Автор

Love the way, he frames his own test cases and cross check the code

java_bee
Автор

was stuck on this problem for days, solved after hearing your solution. thanks again.

favour
Автор

Can you please add space complexity and time complexity too ? Thank you

sreenag
Автор

What about the test case and with K as 2?
In that case- j wouldn't be able to reach a 0.
How would we get the answer in that case??

abigail
Автор

Can anyone please explain why i-j always gives the correct result without keeping track of the max subarray at all times.

Rose-ymmh
welcome to shbcf.ru