How To Remove Duplicates From Sorted Array ( LeetCode 26 ) | FREE DSA Course in JAVA | Lecture 65
Вставка
- Опубліковано 1 лют 2023
- We are going to solve a Leetcode problem number 26 in which you have to write a program to remove duplicates from a sorted array.
So for a given sorted array like 2,3,3,4,4,6,6 you have to remove the duplicate elements and return the array in the form 2,3,4,6.
Now there is a simple brute-force approach to this program where you can use two variables and check linearly the duplicates.
But as a student of coding who is learning DSA, you must always look for an optimal solution that consumes the least time.
Let's see how we can more efficiently solve this program of removing duplicates from an array.
For more information, fill out this form: forms.gle/8eiUmM92Fx563Aen9
or call us at 8884881203
Facebook: / thetapacademy
Instagram: / tapacademy_online
Linkedin: / 73820805
Website: www.thetapacademy.com
#java #array #programming #arrayjava #dsa #dsaplaylist #dsacourse #programmer #job #placementtraining
I HAVE NEVER SEEN ANYONE EXPLAIN LIKE THIS.❤
this is man is the best teacher. i never see before. my God bless you and your family aamiin
Brother thank you so much for taking your time to explain the logic , lots of you-tubers rush through to make their video short . Please upload more videos like this and explain it slowly. Thanks again, and GOD BLESS
Solution without temporary array is amazing!
I have never come across such wonderful explanation video. Thankyou so much bro for the video 😊.
The way you explain is wonderful.
Just amazing explanation ❤ thanks alot
Beautifully explained sir👍
Best Explaination Thank You Sir
no one is explain like this thank you so much sir
Amazing explanation 🤟🤟
your explanation is too good😍😍😍
Excellant teaching sir thank you❤
Thank you bro you explanation is super
Simply Awesome brother ---- My suggestion is Could you please teach with Real-life Examples taking Eggs, or any items to Explain Clearly for Better Understanding to students ... Thank you for your Teaching Style
isme kya real life example chahiye bey
@@jatin9987 usko boiled egg pasand honge bhai don't judge
Awesome explanation.
I rarely comment on youtube videos, but I must say this video is superb and well explained. You made it really simple, most especially when you mentioned you needed two persons to go through the array...............thank you
Very nice explanation: This whole world of teaching is sucks.. and f ks.. naming variables with i and j 's but your naming variable's in meaningful manner which really helps alot for junior to senior. I bow you . Please keep doing many more. I will share my friends what's groups
Thanks for the appreciation.
thanks bhaiya for super explanation
nice explanation sir
Beutiful explaination
Thank you brother
nice one bro
Amazing
sir super explantion
Visualisation always helps
Sir please tell me where you mention, that first element will be same as of previous array's first element in main code. Please tell me 😢
sir please upload more videos of dsa topics
beautiful masterful glorious
What is time complexity of this algorithm?
amazing mannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
What is it time complexity?
LeetCode must put your solutions in their Editorial section. Credit must be given to you.
Sir can we also provide Python code at the same time....concepts are clear but understaing the Java is bit difficult
❤
Sir this code is not submitting on leetcode, even when the Logic is 100% Correct and working Perfectly in VS Code
please sir
upload more topics
Rd Index 3 means
sir 169ms runtime, is it good or bad ?
Sir question about Array Rotation
Coming up with this lecture today. Stay tuned
This will work for unsorted array??
And we can use hashmap for unsorted array
Do recommend Tap Academy in your community. It will be great if you can share our channel in your whatsapp groups amongst your friends.
Personally I am suggesting student sir about u , really ur awesome the way u explain first meeting with u I will always remember re
😇
Edge cases not covered
The duplicate elements are continuosly placed one another so only its working but if the duplicate elements are placed randomly means it will not work properly so please checkout this problem and correct code
My friend the question says sorted array !
This is not feasible solution. Remove duplicates from array means it shouldn't be there. But still it is available inside array
It is the most optimal solution.
It's inplace just slice till what you need.
@@khanra17 brother suppose I will tell remove water from glass. Then what u will do ? U will empty the glass or still u will keep water ? U should remove all the water correct. Similarly here remove elements from array means the elements should remove permanently from array.
Cut the glass of required length lol @@codingcure788
Yes there are some problems in that method
public class Spiral {
static void removeDuplicate(int[] arr){
int rd=0;
for(int i=0; i
what about 234324?
I am not getting correct output in case of below code:
If anyone can help? What's wrong with this code?
public class remDuplicates {
static int removeDuplicate(int[] arr) {
int rd = 0;
for(int i=1; i
bro this solution is only for sorted array you cant give input in unsorted order
you can first sort the array and then send it to the function like these
int[] arr = { -15, 1, 2, 3, 4, 5, 0, 3, 3, 1, 4 };
System.out.println(Arrays.toString(arr));
Arrays.sort(arr); // sorting
int rd = removeDuplicate(arr);
for(int i=0; i
@@mdnouman5396 Thank you for your help.
Bro even you sorted the array. The output is will not come properly. Because remove elements mean it shouldn't be there.
Sound 😢
u look like kl rahul
Real it's too good to understand 🫡