Find Second Largest Element in Array | Remove duplicates from Sorted Array | Arrays Intro Video

Поділитися
Вставка
  • Опубліковано 28 лип 2024
  • Notes/C++/Java/Python codes in Step 3.1 of bit.ly/tufA2ZYt
    Largest Element: takeuforward.org/data-structu...
    Second Largest: takeuforward.org/data-structu...
    Check if Sorted: takeuforward.org/data-structu...
    Remove Duplicates: takeuforward.org/data-structu...
    Practice Link:
    Largest Element: bit.ly/3CuLIR3
    Second Largest: bit.ly/3GJie4l
    Check if Sorted: bit.ly/3XsgYIH
    Remove duplicates: bit.ly/3if2k8G
    Full Course: bit.ly/tufA2ZYt
    You can follow me across social media, all my handles are below:
    Linkedin/Instagram/Telegram: linktr.ee/takeUforward
    0:00 Introduction of Course
    0:54 Basics of array
    6:33 Introduction of Brute, Better and Optimal Approaches
    8:50 Largest element in an array
    11:39 Pseudo code
    12:44 Code-compiler
    13:30 Second Largest element in an array
    23:48 coding implementation
    28:42 Check if the array is sorted
    30:00 Pseudo code
    30:49 Code-compiler
    31:26 Remove duplicates in place from Sorted array
    40:40 Pseudo code
    42:12 Code-compiler

КОМЕНТАРІ • 791

  • @takeUforward
    @takeUforward  Рік тому +223

    Let's march ahead, and create an unmatchable DSA course! ❤
    Use the problem links in description.

    • @ParasSharma-mf8or
      @ParasSharma-mf8or Рік тому

      I will add it, don't worry

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

      Hey striver,
      Just a small request, If is it possible then try to paste your video Clip in Right hand side in the lectures, as previous lectures.
      Because it's a habit of long time to see the solution or explains in left hand side.
      Just a silly request... 😂

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

      456 a to z start kar diye h 😊

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

      HAVE UNDERSTOOD_COMPLETELY

    • @039puneethbatchu2
      @039puneethbatchu2 Рік тому +1

      Hello sir, You're so much passionate about teaching. Each and every word of your video goes into my mind . Thank you sir.

  • @bhaiookabhai
    @bhaiookabhai 6 місяців тому +104

    started today and completed the first video very well explained! thankyou so much!
    will continue the streak and will update below every video after successfully watching it!
    edit: whenever someone likes this comment i get reminded!

  • @mindpower185
    @mindpower185 Рік тому +46

    GOAT respect ++ because no one can explain the TC & SC for begineers in whole youtube i saw all videos. but no one can expalin like you

  • @mahmoodakhtar-df1ze
    @mahmoodakhtar-df1ze 4 місяці тому +10

    I was wondering how my friends were studying so well, then I found out they were all studying from here, man.♥
    You have the best way of explaining things!
    You start everything from scratch and then build it up so well. ♥

  • @yhbarve
    @yhbarve Рік тому +127

    The 2-pointer method is so efficient compared to brute force...and it's so short as well...loved it! Understood

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

      can you tell me in code to find slarge why we write elseif block

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

      @@CodewithKing360 public static int largest(int num[]) {
      int max = 0;
      for (int i = 0; i < num.length; i++) {
      if (num[i] >= max) {
      max = num[i];
      }
      }
      return max;
      }

  • @abhijeetmishra3804
    @abhijeetmishra3804 Рік тому +9

    The video was awesome and so were you with your method of teaching. Hoping that it goes ahead in same way. Thank you, keep growing and keep posting.

  • @chintamanipala
    @chintamanipala 9 місяців тому +10

    I loved your teaching style as well as how we can build our logic from a brute force approch to optimal approch ❤❤❤

  • @siddhant2943
    @siddhant2943 Рік тому +44

    Thank you for this fantastic and well-structured course Striver. I just started into the world of problem-solving and found it very difficult to follow along on tutorials. But after I started watching your videos my mind began to think of an approach before looking for solutions. Though I still find it challenging to write all the code by myself, I am happy that I have started making progress on the problem-solving part. Things are making sense and I am able to come up with different scenarios before actually solving the problem.

    • @user-db3xz3oz6s
      @user-db3xz3oz6s 10 місяців тому +1

      bro i am starting dsa. how is strivers for that? also apne kitna kaar liya hai

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

      @@user-db3xz3oz6s striver is amazing, just that you have to practice a lot of questions. just watching striver videos alone will help a little, main thing is rigorous practice.

  • @JohnCena-uf8sz
    @JohnCena-uf8sz 9 днів тому +4

    I am watching in sequence, the best explanation frrrr.. SOME ONE REMIND ME TO STUDY BY LIKING THE COMMENT

  • @parthkandwal8343
    @parthkandwal8343 Рік тому +17

    You are doing an amazing job Sir by providing such brilliant content. Thank you very much Sir.

  • @jaykaantshikre751
    @jaykaantshikre751 11 місяців тому +8

    Understood , Never thought easy problems could be solved with such optimal solutions.

  • @shubhrajit2117
    @shubhrajit2117 7 місяців тому +12

    At 34:28 the set can be made simply as
    set st(arr, arr + n);

  • @Manishgupta200
    @Manishgupta200 Рік тому +15

    Superb Striver. The Removed duplicates was much thinkable but solved finally. Thankyou for such an amazin tutorial

  • @Dev2.0
    @Dev2.0 Рік тому +93

    Completed DP series... That's pure Gold..
    Now watching this series to revise concepts....
    Striver Bhaiya You are my inspiration 🥺🥺

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

      Is that Dp series helpful to clear google dsa rounds??

    • @saswatrath4646
      @saswatrath4646 4 місяці тому +2

      yes, super helpful uske sath agar love babbar and interviewbit ka addditional questions laga dega to interview bhi clear ho jayega @@AppaniMadhavi

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

      Tq for giving clarity@@saswatrath4646

    • @aditiapar9355
      @aditiapar9355 13 днів тому

      @@saswatrath4646 bs dp mei ya har topic mei in dono k additional question lgao?

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

    Just completed. It was amazing, the way you explain, hats off to you
    Thank you.

  • @VishnuKumar-vi8hh
    @VishnuKumar-vi8hh Рік тому +10

    It was great learning Thanks❤ Bhaiya
    I have now more interested in coding after seeing your playlist , always feels motivated.

  • @AbhishekSingh-mh2fg
    @AbhishekSingh-mh2fg 11 місяців тому +5

    Watching this video after solving these problems. For the Remove duplicates, i did it like if array[i] < array[i++] if yes then increase the count.
    I really like the way you explain.

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

    It has been fantastic! Even as a beginner, I'm able to understand complex problems thanks to your clear explanations. Thank you for making such high-quality content!

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

    this course your explanation is just wow ; I am regretting that this piece of gold Ive found a bit late

  • @cinime
    @cinime Рік тому +8

    Understood! Super fantastic explanation as always, thank you very much!!

  • @AmartyaPardeshi
    @AmartyaPardeshi 11 місяців тому +5

    Great efforts, thanks for this precious course!

  • @thor1626
    @thor1626 Рік тому +11

    Thanks for the amazing explanantion, i was stuck on the duplicates question, but you made it very easy, thanks. keep going.
    //(11/7/23 || 4:38 am)

  • @user-bj9qx9yf1o
    @user-bj9qx9yf1o 9 місяців тому +3

    Great explanation, no rocket science and maths, Thank you for such great content.

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

    I'm enjoying now to do DSA !!!
    Thanks Striver, thanks a lot.

  • @priyanshi3265
    @priyanshi3265 Рік тому +5

    Thank you striver for the amazing explanation 😊

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

    Such a big thing to share your knowledge in this free platform while there r lots of paid platforms... Thanks a lot
    Understood bruh

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

    bhaiya you are just awesome! you are an insipiration for the whole student community! big shoutout yo you! continue like tha ,you make many student future bright

  • @codeedict3919
    @codeedict3919 Рік тому +5

    Understood...🔥🚀🔥 || Loving it so far. Thanks for amazing content.

  • @rnjnmhta.catomato
    @rnjnmhta.catomato 10 місяців тому

    your explanation feels like pure science! beautiful man

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

    understood, and the idea of not making very long videos is superb. Long videos are scary.
    thanx for ur efforts

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

    Thankyou for giving this well structured course.

  • @pranshuatrey
    @pranshuatrey Рік тому +8

    My damm god, how on earth anyone can teach so brilliantly. Sir u are such a gem.. 💎💎💎💎

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

    this is the first time i'm studying from this channel and you're the best. I'm literally enjoying solving questions today, thankyou so much for this❤

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

    Thank you for this video, I understood whole concept which was discussed in this video.

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

    Thank you striver for putting so much effort into making these videos.
    Thank you again :)

  • @ryanmathew6397
    @ryanmathew6397 11 місяців тому +5

    Great!! I tried to make an algorithm using this same methodology to find kth largest element by making and vector of size k. but i came out to be O9n^3) it seems. But really great full for your explanation.

  • @ayushi4411
    @ayushi4411 Рік тому +100

    Sir plz upload the videos as soon as possible coz we have to wait for a single video for about two weeks 🥹🥲

    • @takeUforward
      @takeUforward  Рік тому +66

      Yes we are going every alternate day now!

    • @ayushi4411
      @ayushi4411 Рік тому +7

      @@takeUforward thanks sir!!!

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

      Yes sir ur videos are best for revising dsa

    • @Lucifer-xt7un
      @Lucifer-xt7un Рік тому +3

      ​@@takeUforward sir please upload videos alternatively as promised becoz relaying on you completely🥺🥲

    • @BhanuPratapSinghRajawat-iz2tf
      @BhanuPratapSinghRajawat-iz2tf Рік тому +16

      @@Lucifer-xt7un BRO HE IS PROVIDING THE BEST FREE CONTENT OF DSA AND ALSO HE IS A SOFTWARE ENGINEER AT GOOGLE SO HE HAVE TO DO HIS WORK TOO SO PLZ TRY TO UNDERSTAND HOW MUCH BUSY HE IS BUT STILL HE IS PROVIDING THE BEST CONTENT TO US

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

    Sir you're a Legend and I have a new interest in Coding after watching your videos and practicing constantly. Thank You ❤

  • @Swati-uy6wg
    @Swati-uy6wg 11 місяців тому

    This course helped me a lot. Thankyou bhaiya!

  • @cheddar4848
    @cheddar4848 Рік тому +5

    Hello striver. The python code in the remove duplicates article is incorrect, as in python the set does not store the values in an ordered way. So while replacing the items in the original list, the updated list might not be sorted. What we can do to fix this is convert set into a list and sorting it, before iterating through it and updating in the original array.
    Correct Implementation:
    def removeDuplicate(arr, n):
    res = list(set(arr))
    res.sort()
    i=0
    for item in res:
    arr[i] = item
    i+=1
    return len(res)

  • @PrithaMajumder
    @PrithaMajumder 2 місяці тому +1

    Raj, Thanks a lot for This Amazing Video about C++ Arrays
    Video - 1 Completed ✅

  • @vanshjim6179
    @vanshjim6179 9 місяців тому +1

    mind blowing explaination man . thank you for this content makes more and more

  • @madhukiran8093
    @madhukiran8093 11 місяців тому +1

    Helpful in getting back on track
    after a long Break

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

    Amazing explanation !

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

    Understood! Thanks a lot striver for this amazing content. Love from Kolkata

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

    great! understood very well

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

    I am on the who found this channel very late but der aaye durust aaye.These topics are crystal clear in my mind after watching this video
    Thanks for your effort

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

    Thank you for such a wonderful content

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

    Understood bhai
    Remove duplicates, 2 pointer method and Rest all problems take an element of the array, run the for loop and compare that element to the current value.
    Thank you Striver Bhai

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

    very great explaination, understood sir!

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

    Mindblowing video on arrays in c++ ;
    thanks striver bhaiya for providing all these awesome materials at free of cost ;
    😇

  • @ShubhamKumar-km8pm
    @ShubhamKumar-km8pm Рік тому

    Awesome explanation striver🔥

  • @mayankukarde9288
    @mayankukarde9288 6 місяців тому +2

    For question - Check if array is sorted or not
    Alternative way which we can write instead of writing blank IF body
    boolean isSorted = true;
    for(int i=1; i< n ; i ++){
    if(a[i] < a[i-1]){
    isSorted = false;
    break;
    }
    }
    System.out.print(isSorted);

  • @Prasadk2003
    @Prasadk2003 8 днів тому

    Today I began the journey of solving problems of DSA , Thank you striver for this great series

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

    Awesome lecture bhaiya❤

  • @AniketKumar-hf2bo
    @AniketKumar-hf2bo 6 місяців тому

    understood everything ,thank you for this amazing video

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

    Thankyou for your efforts and knowledge for us 😊

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

    wonderful explanation understood!!

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

    you are doing a great job striver.

  • @aayushsingh5614
    @aayushsingh5614 6 місяців тому +1

    This guy will make every BUSINESS TEACHER'S business down for sure.....

  • @MaheshKumar-jc8sp
    @MaheshKumar-jc8sp 10 годин тому

    Excellent Mentor till date, great conceptual briefing. Also great tips on preparation as well, Thank you, for this help the underpriviliged like me enormously. If you dont want to spend a lot and still want to Up-skill your career this is the Channel you must refer to.

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

    understood and very much appreciated

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

    This series is very helpful i requested to u plz make a oops video in depth

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

    waited since afternoon for this... now starting

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

    Understood everything, Thanks a lot

  • @mehaksharma9391
    @mehaksharma9391 Рік тому +10

    we know your schedule is quite busy but still is a requestttt videos jldi upload kro bhaiya placements haiiiiii...and dsa ap hi se pdnaaa hme

    • @takeUforward
      @takeUforward  Рік тому +5

      Yes we are going every alternate day now!

    • @Tussu17
      @Tussu17 Місяць тому

      Ho gaye placement aapki?

  • @MaheshKumar-jc8sp
    @MaheshKumar-jc8sp 10 годин тому

    Excellent Mento till date, great conceptual briefing.

  • @Enigma-fk7mh
    @Enigma-fk7mh 5 місяців тому

    Thanks i truly understand the code & wondeful lecture :)

  • @aswindilip6166
    @aswindilip6166 Місяць тому

    Understood! your explanation was excellent ❤

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

    Understood. thank you so much for this video.

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

    This consistency is what I'm expecting bhaiya

  • @Omkar-fg4ws
    @Omkar-fg4ws 5 місяців тому +1

    thank you so much bhiya , for providing dsa sheet and explaing the problems.

  • @ganeshv045
    @ganeshv045 7 місяців тому +1

    Hi striver, one observation I have made is, on finding 2nd largest , in brute force approach, if we have the 1st largest number is >1 times then only we need to back traverse the array for finding 2nd largest, in other case (other element's duplication) we don't need to back traverse an Array. am I right..? is there any test case that will fail my thought.. please let me know that test case so that I will rectify my mistake.

  • @seriousname-uh6lq
    @seriousname-uh6lq 4 місяці тому +1

    u are so amazing, I really now like to study. Thanks

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

    bhaiyya aapse hi sikha he sab kuch, thankyou again raj bhaiyya

  • @alikhanmehboob610
    @alikhanmehboob610 9 днів тому

    Thanks for the amazing explanation. You earned yourself a subscriber!

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

    hey man I really really respect you as a person.

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

    Best course for dsa 🔥🔥

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

    Bhaiya your approach towards the remove duplicates is very good 😉

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

    Amazing videos sir.🙏

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

    Understood. Thanks bhaiya.

  • @ashokmunnuru-fe8xr
    @ashokmunnuru-fe8xr Рік тому

    Understood Thank you Striver

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

    Understood thanks bhaiya 💌

  • @DeepaPatel-bq8fm
    @DeepaPatel-bq8fm 3 місяці тому

    You are so good in simplifying things

  • @aliakbaransaria3-925
    @aliakbaransaria3-925 11 місяців тому

    Very good explanation 👏 👌

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

    Understood Great explanation

  • @VishalGupta-vn8ey
    @VishalGupta-vn8ey Рік тому

    Understood clearly bhaiya !!

  • @samatlit
    @samatlit 4 місяці тому +3

    The first 6 minutes are more than sufficient for me to pass the whole semester tbh

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

    Understood....Thank u striver❤

  • @ganeshgavhar5075
    @ganeshgavhar5075 9 місяців тому

    Thanks buddy for helping us!!!

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

    Simple and easy 👍

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

    Understood, Thank You!

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

    where can i find the complete lectures of DSA of your's ?

  • @MaheshKumarS-mt6ot
    @MaheshKumarS-mt6ot Місяць тому

    thank you brother for this kinda of efforts !!! definitely it will help me a lot to get placed in reputed company🤗🤩

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

    Understood, thank you very much bhai

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

    Just searching for this from a long time

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

    Understood!
    Thank You so much

  • @letsdecodewithharsh
    @letsdecodewithharsh Місяць тому +1

    You are great man in explaining the concept too much easy way ♥

    • @AtulRawat-sf2lw
      @AtulRawat-sf2lw Місяць тому

      bro college join krne wala hoon pls thoda sa guide kr dijiye

  • @Deepak-hv8uh
    @Deepak-hv8uh 6 місяців тому +2

    bhai ne kya gajab samjhaya hai, maza aa gaya

  • @sonukumar-oe1tr
    @sonukumar-oe1tr Рік тому

    understood
    i love the way to teach