Find the disappearing numbers (LeetCode 448) | Full solution with examples | Study Algorithms
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
your explanation is too good every one can understand . thanks bro
Wow, Amazing Explanation 🥰🙏Thank You❤
That's pretty clever. Really interesting solution.👍
thank for the video) 💘
great explanation👍👍
Thank you so much
you are underated
Fire 🔥 bro
thaaanks
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
2 жыл бұрын
Yep…this solution will also be optimal
Thanks
Good bhaiya
you have made this approach ?? by the way ,i liked this approach
No need to create new array while multiplying with -1?
@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
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
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
2 жыл бұрын
@@nikoo2805 thank u...can u share the brute force code please?
Making Video is So long for no reason Thuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
@nikoo28
2 ай бұрын
Everyone has a different learning pace my friend. For quick learners there are always timestamps and chapters you can skip to :)