RESTORE IP ADDRESSES (Leetcode) - Code & Whiteboard

preview_player
Показать описание
Here we use backtracking to answer the Restore IP Addresses problem, Leetcode 93.

Time Complexity: O(1) because of the small and finite number of combinations we're going to be checking. We have (up to) 3 options on where to put the first dot, and then the same for the next two. 3 * 3 * 3 = 27 possible checks we're going to make.

Space Complexity: O(1) as well. With a maximum of 27 checks, there will likely be well below that many possible combinations, meaning neither the call stack nor the output array will exceed a size of 27.

Let me know if you have any questions! :)

---------------------------------------------------------------------------------------------------------------------------------------------------------------
Let's connect on LinkedIn!

Follow me on Medium!

Questions or suggestions for new videos? Email me!
Рекомендации по теме
Комментарии
Автор

This is the simplest version I've come across, can't thank you enough

ANUSHAKRISHNA-mk
Автор

Great roadmap for your explanation -> whiteboard, then pseudocode in very clear terms, ending with readable and reasonable code. Keep it up.

adamkalimi
Автор

Thank you so much, it was awesome explanation for this problem i found, i have seen almost 7 to 8 tutorials for this question, but yours was best and easy to understand

hackytech
Автор

Seriously amazing explantation. Easy to build intuition while watching this.

samiahmadkhan
Автор

nicely explained bud! thank you so much!

golammuhaimeen
Автор

This has to be the best explanation on this question. It would be nice if you could reupload or rerecord this problem. The audio and video weren't in sync and made it difficult to follow. Thank you!!

OverLordOfDardWorld
Автор

Awesome explanation, I finally understood this problem.

ioan-dumitruhadarean
Автор

Thank you! It is an excellent explanation👏

merry
visit shbcf.ru