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

КОМЕНТАРІ • 68

  • @Ratan_tata_jii
    @Ratan_tata_jii 10 місяців тому +12

    I HAVE NEVER SEEN ANYONE EXPLAIN LIKE THIS.❤

  • @abdihaashin1350
    @abdihaashin1350 8 місяців тому +2

    this is man is the best teacher. i never see before. my God bless you and your family aamiin

  • @ahsankazi9837
    @ahsankazi9837 2 місяці тому

    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

  • @shubhammanecr7
    @shubhammanecr7 5 місяців тому +1

    Solution without temporary array is amazing!

  • @ManishJaiswal-sh3jm
    @ManishJaiswal-sh3jm Місяць тому

    I have never come across such wonderful explanation video. Thankyou so much bro for the video 😊.

  • @danonthedaily
    @danonthedaily 25 днів тому

    The way you explain is wonderful.

  • @ankithareddy4497
    @ankithareddy4497 10 місяців тому

    Just amazing explanation ❤ thanks alot

  • @newminds8619
    @newminds8619 10 місяців тому

    Beautifully explained sir👍

  • @prasadnakade8267
    @prasadnakade8267 8 місяців тому

    Best Explaination Thank You Sir

  • @naidulipsa
    @naidulipsa 3 місяці тому

    no one is explain like this thank you so much sir

  • @abhijitkumar5221
    @abhijitkumar5221 6 днів тому

    Amazing explanation 🤟🤟

  • @SoniYadav-pe9hn
    @SoniYadav-pe9hn 4 місяці тому

    your explanation is too good😍😍😍

  • @bokinalavijay6876
    @bokinalavijay6876 8 місяців тому

    Excellant teaching sir thank you❤

  • @shanmukhasridharreddypittu229
    @shanmukhasridharreddypittu229 11 місяців тому

    Thank you bro you explanation is super

  • @MohammedSameer-rx5rz
    @MohammedSameer-rx5rz Рік тому +7

    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

    • @jatin9987
      @jatin9987 4 місяці тому +1

      isme kya real life example chahiye bey

    • @saarza9991
      @saarza9991 3 місяці тому

      ​@@jatin9987 usko boiled egg pasand honge bhai don't judge

  • @Manishkumar-qy7zf
    @Manishkumar-qy7zf Місяць тому

    Awesome explanation.

  • @zainabalayande278
    @zainabalayande278 Рік тому +1

    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

  • @srin42
    @srin42 Рік тому +6

    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

  • @DeepakKumar-oz5ky
    @DeepakKumar-oz5ky 9 місяців тому

    thanks bhaiya for super explanation

  • @ThirdParty886
    @ThirdParty886 4 місяці тому

    nice explanation sir

  • @ramchandrajadhav5648
    @ramchandrajadhav5648 6 місяців тому

    Beutiful explaination

  • @user-ei3ng5kt4n
    @user-ei3ng5kt4n Місяць тому

    Thank you brother

  • @PavanKumar-bv6jr
    @PavanKumar-bv6jr 6 місяців тому

    nice one bro

  • @sulagnasarkar7332
    @sulagnasarkar7332 11 місяців тому

    Amazing

  • @posachowdamma7710
    @posachowdamma7710 10 місяців тому

    sir super explantion

  • @prajwalm.s7976
    @prajwalm.s7976 8 місяців тому

    Visualisation always helps

  • @AestheticWorld_04
    @AestheticWorld_04 2 місяці тому

    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 😢

  • @user-bl9ph5eg7z
    @user-bl9ph5eg7z 4 місяці тому

    sir please upload more videos of dsa topics

  • @BOSS55
    @BOSS55 11 місяців тому

    beautiful masterful glorious

  • @ryanafzal4129
    @ryanafzal4129 8 місяців тому

    What is time complexity of this algorithm?

  • @guessme424
    @guessme424 5 місяців тому

    amazing mannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn

  • @aneesahassan8512
    @aneesahassan8512 5 місяців тому

    What is it time complexity?

  • @pragmaticcoder6910
    @pragmaticcoder6910 5 місяців тому

    LeetCode must put your solutions in their Editorial section. Credit must be given to you.

  • @user-mg1my1zg7p
    @user-mg1my1zg7p 7 місяців тому

    Sir can we also provide Python code at the same time....concepts are clear but understaing the Java is bit difficult

  • @nethminafernando3749
    @nethminafernando3749 8 місяців тому

  • @princenagar1686
    @princenagar1686 7 місяців тому

    Sir this code is not submitting on leetcode, even when the Logic is 100% Correct and working Perfectly in VS Code

  • @user-bl9ph5eg7z
    @user-bl9ph5eg7z 4 місяці тому

    please sir
    upload more topics

  • @rutujasangole7593
    @rutujasangole7593 10 місяців тому

    Rd Index 3 means

  • @ashutosh_code
    @ashutosh_code 3 місяці тому

    sir 169ms runtime, is it good or bad ?

  • @abhijithsuresh5334
    @abhijithsuresh5334 Рік тому +3

    Sir question about Array Rotation

    • @TAPACADEMY
      @TAPACADEMY  Рік тому +1

      Coming up with this lecture today. Stay tuned

  • @dipakbadgujar1238
    @dipakbadgujar1238 Рік тому +1

    This will work for unsorted array??
    And we can use hashmap for unsorted array

    • @TAPACADEMY
      @TAPACADEMY  Рік тому

      Do recommend Tap Academy in your community. It will be great if you can share our channel in your whatsapp groups amongst your friends.

    • @Prashantkumar-hb8kt
      @Prashantkumar-hb8kt Рік тому

      Personally I am suggesting student sir about u , really ur awesome the way u explain first meeting with u I will always remember re

  • @HusnaKhanam-bm4fq
    @HusnaKhanam-bm4fq 5 місяців тому

    😇

  • @babitakumari-ln1zb
    @babitakumari-ln1zb 8 місяців тому

    Edge cases not covered

  • @vishalsmart3763
    @vishalsmart3763 4 дні тому

    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

  • @codingcure788
    @codingcure788 8 місяців тому +9

    This is not feasible solution. Remove duplicates from array means it shouldn't be there. But still it is available inside array

    • @khanra17
      @khanra17 5 місяців тому +3

      It is the most optimal solution.
      It's inplace just slice till what you need.

    • @codingcure788
      @codingcure788 5 місяців тому +2

      @@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.

    • @_sarthakmisal
      @_sarthakmisal 5 місяців тому

      Cut the glass of required length lol ​@@codingcure788

    • @SuvoBiswas-eh9sp
      @SuvoBiswas-eh9sp 4 місяці тому +2

      Yes there are some problems in that method

    • @SuvoBiswas-eh9sp
      @SuvoBiswas-eh9sp 4 місяці тому

      public class Spiral {
      static void removeDuplicate(int[] arr){
      int rd=0;
      for(int i=0; i

  • @aleefsultan176
    @aleefsultan176 2 місяці тому

    what about 234324?

  • @Timeless_Trader
    @Timeless_Trader Рік тому +3

    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

    • @mdnouman5396
      @mdnouman5396 Рік тому +2

      bro this solution is only for sorted array you cant give input in unsorted order

    • @mdnouman5396
      @mdnouman5396 Рік тому +1

      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

    • @Timeless_Trader
      @Timeless_Trader 11 місяців тому

      @@mdnouman5396 Thank you for your help.

    • @codingcure788
      @codingcure788 8 місяців тому

      Bro even you sorted the array. The output is will not come properly. Because remove elements mean it shouldn't be there.

  • @IrfanB-jq1nt
    @IrfanB-jq1nt 25 днів тому

    Sound 😢

  • @Ashleysarash
    @Ashleysarash Рік тому

    u look like kl rahul

  • @user-gd3zj1cz8p
    @user-gd3zj1cz8p 4 місяці тому

    Real it's too good to understand 🫡