Word Break | LeetCode 139 | Python 3 | Easy to Understand

preview_player
Показать описание
Hello Coders! In this video, we will be working on a very interesting problem, as I have seen this type of questions multiple times this year in my interviews! We will be discussing Dynamic Programming as a solution to this problem.

This video is divided into 3 parts:

Part I: Problem description and the most intuitive solution 0:33
Part II: Optimized solution 3:05
Part III: Actual code to the optimized solution 9:58

Runtime: O(n^2)
Space: O(n)

Hope you enjoy this video and good luck 💙

Try my LeetCode list:

Let's be friends:
Рекомендации по теме
Комментарии
Автор

Your videos are helping me a lot to get prepared to my tomorrow's interview, thanks!! 💜

angielollipop
Автор

great video! This is the first explanation that really worked for me. Maybe because it is the first one where I have seen a woman explain it! :)

oliviatierney
Автор

Thanks so much for this! Since you're using string splice on line 11 and that is splicing for every loop, isn't the time complexity actually O(n^3)?

tl
Автор

Thanks for taking the time to explain. This might be a dumb question, but how do we know that the "null string will definitely be in the dictionary"? I've seen this in other DP solution explanations to this leetcode problem, but have never understood how someone arrives at that conclusion since there is no empty/null entry in wordDict?

strthruthenight
visit shbcf.ru