WORD BREAK | PYTHON | LEETCODE # 139

  Рет қаралды 4,802

Cracking FAANG

Cracking FAANG

Күн бұрын

Пікірлер: 20
@landocodes
@landocodes 10 ай бұрын
Bro I love how honest you are!! It really really makes you stand out against all of the other KZbinrs who provide leetcode solutions. Keep it up man I’m a fan 🙌🏾
@crackfaang
@crackfaang 10 ай бұрын
Haha yea I like to keep it real, especially with the shit questions.
@alabamatabasco3418
@alabamatabasco3418 9 ай бұрын
"Dynamic programming is shit"... sirens in the background lmao
@hennessyypapi
@hennessyypapi Жыл бұрын
thank you for everything. out of all the major youtubers, your explanations resonate the most with me.
@fadsa342
@fadsa342 Жыл бұрын
I used recursion with memoization to solve the problem but your solution is a lot easier to grasp if I'm being honest. Out of curiosity can BFS be applied to most problems that you'd normally use DP or recursion for? And do you have any resources for getting better at determining space/time complexity?
@crackfaang
@crackfaang Жыл бұрын
I generally stay away from anything DP because I find the concept total bullshit. I will when necessary use recursion + memoization to get around standard DP problems. I always look for the DFS/BFS solution where it exists because my brain can very easily understand and code those, whereas DP is too much of a mind-bend. In terms of getting better at time/space complexity analysis, it really comes down to repetition and understanding the basics of what operations are what which then stack on top of each other when applied in a larger algorithm
@TheSmashten
@TheSmashten Ай бұрын
Love the BFS approach, so much simpler than DP and intuitive. I hope my interviewer isn't an asshole.
@Soukaina-n9f
@Soukaina-n9f 24 күн бұрын
Thanks a lot for the non-dp solution. But a question please, in time complexity aren't you missing the outer loop ?
@harshithamaripally3776
@harshithamaripally3776 10 ай бұрын
your explanations resonate the most with me.
@crackfaang
@crackfaang 10 ай бұрын
Thanks for the kind words mate! Glad to have you with us on the channel :)
@yemaneabrha6637
@yemaneabrha6637 3 ай бұрын
You have used start with built in function from python right ? but I was considering the goal of this question is to implement prefix , find prefix I mean using tries am I wrong ?
@samvaidya1987
@samvaidya1987 2 жыл бұрын
@4:21 - why do you think we have to process "leet" again?
@lonen3rd
@lonen3rd Жыл бұрын
Because a word can exist multiple times in s e.g. s = "applepenapple"
@eduardoignacioroblessosa6349
@eduardoignacioroblessosa6349 8 ай бұрын
that was a pretty intuitive solution, just beautiful
@akjenksgamer1266
@akjenksgamer1266 2 жыл бұрын
Thank you! I don't like dp either so i'm glad i found another solution
@crackfaang
@crackfaang 2 жыл бұрын
Haha yea I try to avoid DP at all costs. It’s such a stupid and horrendous way of solving these problems
@abbyh2879
@abbyh2879 2 жыл бұрын
It works but I am not sure why BFS?
@crackfaang
@crackfaang 2 жыл бұрын
Well if you can do the brute force solution but you aren't getting the job. So it's now a choice between DFS, BFS, and dynamic programming. I personally fucking hate DP and don't code any solutions in that garbage lol. And I think any time you have a choice between BFS and DFS I would choose BFS because you don't have to worry about recursion and stack overflow. And a lot of the times if you code up the recursive solution they ask for the iterative afterwards. It's up to you what way works best for you. I just went with BFS because it's my preferred solution and the one I can explain the best :)
@abbyh2879
@abbyh2879 2 жыл бұрын
@@crackfaang Thanks for the reply, makes sense. I hate DP too, that's the reason I am subscribed to your channel, because I can always find non-DP solutions here.
@galinabakman9901
@galinabakman9901 2 жыл бұрын
great solution
MINIMUM ADD TO MAKE PARENTHESIS VALID | PYTHON | LEETCODE # 921
9:49
Word Break - Dynamic Programming - Leetcode 139 - Python
15:35
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 35 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 16 МЛН
WORD BREAK II | LEETCODE # 140 | PYTHON DFS SOLUTION
21:20
Cracking FAANG
Рет қаралды 6 М.
Coding Interview Problem - Word Break
20:08
Knapsack
Рет қаралды 23 М.
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 111 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Word Break Problem | Dynamic Programming | GeeksforGeeks
19:07
GeeksforGeeks
Рет қаралды 54 М.
Word Break | Leet code 139 | Theory explained + Python code
12:44
Sai Anish Malla
Рет қаралды 7 М.
Word Break Problem Dynamic Programming
15:51
Tushar Roy - Coding Made Simple
Рет қаралды 181 М.
Word Search II - Backtracking Trie - Leetcode 212 - Python
20:54
ИГРОВОЙ ПК от ИЛОНА МАСКА, Распаковка
32:50
Best Brand Best Keypad Low Price Mobile
0:43
Edit Zone 1.8M views
Рет қаралды 1,1 МЛН
Máy báo động cho gia đình mãi đỉnh
0:31
SaboMall
Рет қаралды 34 МЛН
Анимация логотипа для компании MYCOM
0:46
FreelStep Shorts
Рет қаралды 720 М.
Samsung S4 win this 💀 #trollface #troll #trending #trend #viral
0:19
Okotanis Gaming
Рет қаралды 14 МЛН