MAX CONSECUTIVE ONES III | LEETCODE 1004 | PYTHON SOLUTION

  Рет қаралды 9,777

Cracking FAANG

Cracking FAANG

Күн бұрын

Discord Link: / discord
Question Link: leetcode.com/problems/max-con...
In this video we are solving a simple Facebook/Google interview question dealing with arrays: Max Consecutive Ones III (Leetcode 1004).
This question is marked as a medium but it's really more of an easy and it's super straightforward to solve.
TIMESTAMPS:
00:00 Intro
00:20 Question Prompt
00:30 Example & Solution Intuition
03:19 Coding
06:36 Time/Space Complexity
07:45 Outro

Пікірлер: 84
@WilliamChennn
@WilliamChennn Жыл бұрын
I cry a little bit each time you say its easy and I struggle lol
@crackfaang
@crackfaang Жыл бұрын
We've all been there. With enough practice and repetition you'll get there too. It's just part of the grind unfortunately
@aklsjdhsdlkjhaskldfsdkljdsf
@aklsjdhsdlkjhaskldfsdkljdsf 7 ай бұрын
idk if saying that the problem is more of an easy difficulty is really the best thing to say in a tutorial video where the only ones watching it will be people who struggled
@crackfaang
@crackfaang 7 ай бұрын
lol yea probably true, but still in the grand scheme of things it's one of those where you watch the solution and then it should hopefully all be clearer
@Murphyalex
@Murphyalex 14 күн бұрын
@@crackfaang Doesn't change the criticism though. After being frustrated with the code because we can't solve it, we come to watch for help and then we're told just how fantastically ridiculously simple the solution is (around 3:15). Btw the plural of index is indices. Pedagogically, you shouldn't have gone for the fancy one liner and just done something everyone can visualise. Then of course, add in the fancy one liner at the end as an option. This video solution doesn't have the best interests of the audience in mind. Just a tip for future videos :)
@puneetchhabra9922
@puneetchhabra9922 Ай бұрын
Very Helpful!
@shuier525
@shuier525 5 ай бұрын
Great video! Thank you!
@surajwankhade9238
@surajwankhade9238 5 ай бұрын
Thank you for making these videos!
@youssefhussein3128
@youssefhussein3128 Жыл бұрын
Please continue doing these videos. It really helps
@rsKayiira
@rsKayiira Жыл бұрын
You're a hero for this one!!! Thank you
@JRivero
@JRivero 16 күн бұрын
many thanks!
@preethisowjanya5203
@preethisowjanya5203 Ай бұрын
thank you!
@shaikadish4509
@shaikadish4509 2 ай бұрын
You're a legend
@BieberTaylorLove
@BieberTaylorLove 5 ай бұрын
Thanks a lot!!
@mashareznik4117
@mashareznik4117 2 ай бұрын
Thanks 👍🙏
@NikhilAsawadekar
@NikhilAsawadekar 3 ай бұрын
At 4:10 you say when k equals 1. I think you meant when num equals 1. I rewinded video like 10 times to figure out what's exactly going on. Thanks for the explanation though. Great solution!
@subee128
@subee128 6 ай бұрын
Thank you very much
@Rhythm31
@Rhythm31 5 ай бұрын
Thanks!
@augusto2581
@augusto2581 3 ай бұрын
Thks!
@jonathanhle
@jonathanhle Жыл бұрын
Thanks dude
@user-bu3cz7lf7x
@user-bu3cz7lf7x 8 ай бұрын
thank you :)
@damiancruzfernandez3707
@damiancruzfernandez3707 9 ай бұрын
great explanation
@kamilnuriev7437
@kamilnuriev7437 Ай бұрын
Thanks
@yashkumar9671
@yashkumar9671 4 ай бұрын
thanks
@kolawoleabdulrahman
@kolawoleabdulrahman 7 ай бұрын
great video
@abdullahzafar8589
@abdullahzafar8589 5 ай бұрын
the visual cleared the problem up for me thanks
@crackfaang
@crackfaang 5 ай бұрын
No problem mate glad you enjoyed
@jacobeul7975
@jacobeul7975 11 ай бұрын
great 👍
@winterbird4069
@winterbird4069 5 ай бұрын
thanks :)
@chengjiwei
@chengjiwei 5 ай бұрын
nice
@Lily-xp2vb
@Lily-xp2vb 9 ай бұрын
@HimanshuKumar_24
@HimanshuKumar_24 4 ай бұрын
Ridiculously simple ?!!....let me go and die :p . Thanks for the solution bdw .
@crackfaang
@crackfaang 4 ай бұрын
Haha keep up the practice and you'll soon get to the point where it's a trivial question
@HimanshuKumar_24
@HimanshuKumar_24 4 ай бұрын
@@crackfaang yup …that’s the idea !
@codenoob223
@codenoob223 21 күн бұрын
Hi sir, is this a "Sliding Window" problem or a "Two pointers" problem ? Thanks for the video.
@Christian-mn8dh
@Christian-mn8dh 10 сағат бұрын
sliding window problems typically use two pointers
@TooManyPBJs
@TooManyPBJs 3 ай бұрын
Lol why is this tagged with binary search?
@hooriehmarefat5972
@hooriehmarefat5972 4 ай бұрын
hszvgiwoef! I just smashed my face into the keyboard as you suggested! :))))
@crackfaang
@crackfaang 4 ай бұрын
🤣
@rsKayiira
@rsKayiira Жыл бұрын
Friends Of Appropriate Ages, Diagonal Traverse II, Kth missing Positive number, Minesweeper, Missing Element in sorted array, Exclusive Time of Functions, Check if an Original String Exists Given Two Encoded Strings.
@zeeshanhamid1941
@zeeshanhamid1941 23 күн бұрын
ivavivasncknsaclckn pov I smashed my head in the keyboard
@jarvis9092
@jarvis9092 6 ай бұрын
Hi can someone help why its "if k
@Elena-us3kz
@Elena-us3kz 6 ай бұрын
I have the same question as yours
@landocodes
@landocodes 6 ай бұрын
Seems to just be a preference of his. I changed mine to run that while loop if the k >= 0 condition isn't true and it works. I check if "k >= 0" and if not then "while l < r and k < 0" I think the while loop is a bit more intuitive. I couldn't wrap my head around how to be certain that not using a while loop would work.
@yogeshverma9267
@yogeshverma9267 Ай бұрын
I feel, the idea behind using IF is to keep the window size max, and increase it further if you find even bigger window. WHILE loop is more intuitive but reduces the window size if we keep moving the left pointer.
@user-jl2mp8kq8w
@user-jl2mp8kq8w Жыл бұрын
face smashed***
@alexandersmirnov4274
@alexandersmirnov4274 Жыл бұрын
@Change510
@Change510 Жыл бұрын
👍
@hrushikesh-1914
@hrushikesh-1914 11 ай бұрын
56gtf
@omarabdelkader5214
@omarabdelkader5214 4 ай бұрын
Hi 😆
@crackfaang
@crackfaang 4 ай бұрын
👋👋
@beonthego8725
@beonthego8725 10 ай бұрын
comment
@yaseengousesamudri9390
@yaseengousesamudri9390 Жыл бұрын
cgvheda
@fishraider7897
@fishraider7897 8 ай бұрын
😅
@akakartiksaini
@akakartiksaini 5 ай бұрын
for the algo
@sharathkumar8338
@sharathkumar8338 Жыл бұрын
your previous video got deleted 😭
@crackfaang
@crackfaang Жыл бұрын
I deleted it because the quality wasn’t good enough and it was too long. Will be remaking it
@sharathkumar8338
@sharathkumar8338 Жыл бұрын
@@crackfaang ok sure thank you
@whyisknight6taken
@whyisknight6taken 11 ай бұрын
:)
@mahitnandanad3372
@mahitnandanad3372 Жыл бұрын
kyjr
@user-ld6pe5pi6j
@user-ld6pe5pi6j 6 ай бұрын
.
@ayushharma
@ayushharma 7 ай бұрын
sawd
@crackfaang
@crackfaang 7 ай бұрын
Comment for the algorithm ;)
@eyob_worku
@eyob_worku 4 ай бұрын
jkkkkkkk
@okliam
@okliam 8 ай бұрын
juhikefrfhiu
@akshatagawade4366
@akshatagawade4366 3 ай бұрын
jjjjjj
@fishraider7897
@fishraider7897 8 ай бұрын
Iuuo
@sujaysreedhar8313
@sujaysreedhar8313 Жыл бұрын
8fifrnfeionrewo. There you go! Serious note, you're the best teacher who instills a love of craft.
@mountassirelmoustaaid2672
@mountassirelmoustaaid2672 9 ай бұрын
Thanks
@joyride8284
@joyride8284 2 ай бұрын
nice
@mahadishakkhor123
@mahadishakkhor123 5 ай бұрын
@omaro9627
@omaro9627 10 ай бұрын
comment
@mkzzzzzzzzzz1
@mkzzzzzzzzzz1 Жыл бұрын
for the algo
@crackfaang
@crackfaang Жыл бұрын
You’re the real MVP
@mikedelta658
@mikedelta658 6 ай бұрын
Thanks
@sayeedchowdhury11
@sayeedchowdhury11 5 ай бұрын
Thanks
@anubhavsharma8357
@anubhavsharma8357 Жыл бұрын
@MrTomer157
@MrTomer157 Жыл бұрын
EXCLUSIVE TIME OF FUNCTIONS | LEETCODE 636 | PYTHON SOLUTION
15:42
Cracking FAANG
Рет қаралды 4 М.
Max Consecutive Ones (LeetCode 1004) | Full Solution w/ animations
14:41
Получилось у Миланы?😂
00:13
ХАБИБ
Рет қаралды 6 МЛН
Box jumping challenge, who stepped on the trap? #FunnyFamily #PartyGames
00:31
Family Games Media
Рет қаралды 25 МЛН
LARGEST PALINDROMIC NUMBER | LEETCODE 2384 | PYTHON SOLUTION
14:56
Cracking FAANG
Рет қаралды 1,6 М.
MAXIMUM SWAP | LEETCODE 670 | PYTHON SOLUTION
15:12
Cracking FAANG
Рет қаралды 3,3 М.
ROBOT ROOM CLEANER | LEETCODE # 489 | PYTHON BACKTRACK SOLUTION
19:44
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 243 М.
Big-O Notation - For Coding Interviews
20:38
NeetCode
Рет қаралды 442 М.
LeetCode Max Consecutive Ones III Solution Explained - Java
6:31
Better Than Smart Phones☠️🤯 | #trollface
0:11
Not Sanu Moments
Рет қаралды 20 МЛН
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 509 М.
Лучший браузер!
0:27
Honey Montana
Рет қаралды 1,1 МЛН
Как бесплатно замутить iphone 15 pro max
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
Хакер взломал компьютер с USB кабеля. Кевин Митник.
0:58
Последний Оплот Безопасности
Рет қаралды 2,4 МЛН