Find the disappearing numbers (LeetCode 448) | Full solution with examples | Study Algorithms

  Рет қаралды 8,297

Nikhil Lohia

Nikhil Lohia

Күн бұрын

An integer array of size 'n' contains elements in the range of [ 1, n ] There may or may not be repeating numbers. You need to find the numbers that are disappeared from this range. In this video we explore the most straight forward way to approach this problem and then try to optimize it eventually. The video discusses an in-place solution that is both time and space efficient. All of this along with beautiful animations and visuals. The dry-run of code is also provided in JAVA.
Chapters:
00:00 - Intro
01:13 - Problem statement and description
03:13 - Brute Force Method
05:05 - Space and Time Efficient Solution
09:50 - Dry-run of Code
12:11 - Final Thoughts
📚 Links to topics I talk about in the video:
Array Data Structure: • Array Data Structure e...
Brute Force Solutions: • Brute Force algorithms...
What is Big O?: • Big O Notation Simplif...
Time Complexity of an algorithm: • What is the Time Compl...
📘 A text based explanation is available at: studyalgorithms.com
Code on Github: github.com/nikoo28/java-solut...
Test-cases on Github: github.com/nikoo28/java-solut...
📖 Reference Books:
Starting Learn to Code: amzn.to/36pU0JO
Favorite book to understand algorithms: amzn.to/39w3YLS
Favorite book for data structures: amzn.to/3oAVBTk
Get started for interview preparation: amzn.to/39ysbkJ
🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
🎥 My Recording Gear:
Recording Light: amzn.to/3pAqh8O
Microphone: amzn.to/2MCX7qU
Recording Camera: amzn.to/3alg9Ky
Tablet to sketch and draw: amzn.to/3pM6Bi4
Surface Pen: amzn.to/3pv6tTs
Laptop to edit videos: amzn.to/2LYpMqn
💻 Get Social 💻
Follow on Facebook at: / studyalgos
Follow on Twitter at: / studyalgorithms
Follow on Tumblr at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #programming #interview

Пікірлер: 23
@mindmatters851
@mindmatters851 Жыл бұрын
your explanation is too good every one can understand . thanks bro
@manishjeena6325
@manishjeena6325 Жыл бұрын
Wow, Amazing Explanation 🥰🙏Thank You❤
@CostaKazistov
@CostaKazistov 2 жыл бұрын
That's pretty clever. Really interesting solution.👍
@l1z1ng3r
@l1z1ng3r 7 ай бұрын
thank for the video) 💘
@priyankarai7917
@priyankarai7917 Жыл бұрын
great explanation👍👍
@RavinderSingh-nh6th
@RavinderSingh-nh6th 11 ай бұрын
Thank you so much
@pranav8609
@pranav8609 Жыл бұрын
you are underated
@nerd6134
@nerd6134 2 жыл бұрын
Fire 🔥 bro
@TraderOff-Road
@TraderOff-Road 26 күн бұрын
thaaanks
@nikhilbatchu7910
@nikhilbatchu7910 2 жыл бұрын
Tried this using the count sort. I have created a temp array and stored the frequencies.Is my approach can be considered as optimal?
@nikoo2805
@nikoo2805 2 жыл бұрын
Yep…this solution will also be optimal
@subee128
@subee128 6 ай бұрын
Thanks
@Englishwithhimanshu8581
@Englishwithhimanshu8581 9 ай бұрын
Good bhaiya
@shubhambelwal674
@shubhambelwal674 2 ай бұрын
you have made this approach ?? by the way ,i liked this approach
@vigneshr4197
@vigneshr4197 Жыл бұрын
No need to create new array while multiplying with -1?
@ashrafel-gaaly8657
@ashrafel-gaaly8657 9 ай бұрын
I think you do if some elements in the array are negative. In these examples they are all positive and yes you can update the existing array
@mdanik1361
@mdanik1361 2 жыл бұрын
I couldn’t understand the brute force method and efficient method time complexity difference... In brute force meth, iterating through every elements doesn’t take O(n) too? :)
@nikoo2805
@nikoo2805 2 жыл бұрын
In Brute Force method you are iterating over the array again and again to find the element. So you are doing n iterations for n items. Hence, a time complexity of O(n^2) In the efficient method, you only iterate once Hope that helps :)
@mdanik1361
@mdanik1361 2 жыл бұрын
@@nikoo2805 thank u...can u share the brute force code please?
@RohanSingh-my3nl
@RohanSingh-my3nl 3 ай бұрын
Making Video is So long for no reason Thuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
@nikoo28
@nikoo28 2 ай бұрын
Everyone has a different learning pace my friend. For quick learners there are always timestamps and chapters you can skip to :)
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 76 МЛН
Я нашел кто меня пранкует!
00:51
Аришнев
Рет қаралды 5 МЛН
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 9 МЛН
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
[Rust | nvim] Rustlings 6.0.1, Part 1: Intro and Variables
13:51
Uncle Scientist
Рет қаралды 21
Scientific Concepts You're Taught in School Which are Actually Wrong
14:36
The Last Algorithms Course You'll Need by ThePrimeagen | Preview
16:44
Frontend Masters
Рет қаралды 311 М.
Top 7 Algorithms for Coding Interviews Explained SIMPLY
21:22
Codebagel
Рет қаралды 329 М.
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 76 МЛН