Solving Arrays Questions | Find duplicates in an array | GeeksForGeeks | Nishant Chahar Ep-18

preview_player
Показать описание
In this video, we'll are going to solve some more questions of the array. Arrays are really important because we are going to use them a lot in future topics.

You can use my code NISHANT to get 15% Off on all GFG courses.

✨ Important Links ✨

✨ Hashtags ✨
#NishantChahar #Microsoft #DSA #Recursion #FAANG #NSIT #NSUT #engineering #internship #college

✨tags ✨
Where to learn dp
where to learn graphs
where to learn dsa
how to start programming
how to start coding
where to learn trees
what is memoisation
what is tabulation
what are graphs
where to learn Operating systems
where to learn dbms
where to learn oops
where to learn computer networks
where to learn low level design
where to learn cs fundamentals
Sanchit jain
Gaurav sen
Gate smashers
Placement guide
How to start programming
where to learn cpp
where to learn python
where to learn javascript
where to learn java
Placement guide
Nishant Chahar Placement Guide
languages to learn
resources to learn data structures
Projects development
AR/VR
Blockchain Machine learning
Deep Learning
Software developer engineer ,
Side projects ,
Importance of side projects ,
Machine Learning Engineer,
How to become a machine learning engineer ,
Associate engineer
Data structures Algorithms
College Life, College, Memories
Fun Fests Chill Enjoy
IITD Mood indigo rendezvous IIT
NSUT Moksha DTU Engifest
Bits Bitsgoa
Namaste Javascript
Namaste Javascript Akshay Saini
Apna college
Apna college c++
apna college DSA
Where to learn dp
where to learn graphs
where to learn dsa
how to start programming
how to start coding
where to learn trees
what is memoisation
what is tabulation
what are graphs
where to learn programming
how to start coding
where to learn coding
where to learn DSA
resources to learn programming
how to crack amazon
how to crack placement
blockchain
what is blockchain
blockchain technology
blockchain technology explained
blockchain explained
blockchain technology in hindi
web development roadmap
roadmap to learn web development
android development roadmap
MERN stack roadmap
machine learning roadmap
roadmap to learn machine learning
roadmap for deep learning
roadmap for 2nd years
roadmap for opensource
roadmap for ios development
roadmap for deep learning
roadmap to learn DSA
Рекомендации по теме
Комментарии
Автор

Day 43
Find Duplicates In An Array
Every day, you strengthen and become even more perfect. Your explanations are always accurate and simple to grasp. I appreciate all of the help you have given over the months. Your support is very helpful. Your commitment and teaching skills are outstanding. It was an excellent learning experience that I have so far greatly enjoyed. I appreciate your ongoing support from the beginning. Good luck in the future and keep up the fantastic work. I look forward to getting to know you and spending valuable time with you while learning from you. You are my inspiration and I admire you a lot. You are the best, Nishant Bhaiya!

HarshSharma-ibft
Автор

I literally got goosebumps when I see this approach. Hats off to those who come up with these ingenious ideas
And one suggestion is if possible try this problem
MAXIMUM OF ALL SUBARRAYS OF SIZE K
as the intuition behind the optimized version of this problem is also amazing and I think we all will like it

vikasbagri
Автор

Week 7 is abt to start.
Never felt like it had came such a long way and I could follow it up everyday this long. 😂
Really consistency op😎😎😎
Thanks bhaiya 😊
Shiv

shivdixit
Автор

Thank you for teaching us these approach to the type problems in such a simplified way.

apoorvadubey
Автор

I think even if the question says that array has only one duplicate elements, you still can't use hare and tortoise method because array contains 0.

AbhishekPandey-ylbp
Автор

This method is working but this method is not ideal according to c++ standards, lets say we have array size of 5 and in that array there is an element 13, so if i calculate the index i.e index = arr[i]; // a[i] is 13
a[index] = arr[i]%n; // a[13] = 13%5;
we are accessing 13th element which is out of the range of array and it is working because of the undefined behaviour of C++, it will work for small numbers, if i try to access a large number lets say arr[4000] = 80; it will give me the segmentation fault...
This can cause a major bug in a software.
by the way you are doing great :-)

WaniTech
Автор

Nice to explanation is clear doubt from this video thank you for making this video and this type of video is need to the audience so thank you 🎉❤❤

akashade
Автор

Mast Bhai pora samaj aa gaya...❤️Hyderabad...

manemanoj
Автор

Thanks for the video bhaiya well :)

vishalshrivastav
Автор

But what if all numbers is different like {4, 6, 28, 4, 6} is it possible?

justdoingodswork
Автор

Day 43 me - programming muje smj rhi h, thanks bhaiya :)

sumitkanth
Автор

why are we pushing i in ans vector instead of arr[i]?

Pika-pwjc
Автор

Nishant Bhaiya giveaway ka result kab aayga...eagerly waiting for Microsoft tour 💙

tishagupta
Автор

Bro in Microsoft what role u are working like web developer or app and whether u work in websites or in what

preethig
Автор

Your consistency says everything, great work bhaiya❤️

theparthsingh
Автор

public int findDuplicate(int[] nums) {
int n = nums.length;
int[] ans = new int[n];
for(int ele:nums)
{
ans[ele]+=n;
if(ans[ele]/n>=2)
{
return ele;
}
}
return -1;
}
why we are looping over the array twice ? isn't mentioned above is the precise soln?

nishthaarora
Автор

what an explanation man, thank you so much

shubhamkumarsingh
Автор

Why are you doing redundant %n if all elements are already 0<=num<=N-1 ?

Aman-wid-plan
Автор

Look at 4:42 suppose we have an array element 10 then 10%n(10%5) is do you get that 5th index in the areay

NeelsArts
Автор

but what if range is from 0 to N and not N-1 like in the leetcode question number 442?

yashaggarwal
join shbcf.ru