Cycle Sort - Amazon, Google, Microsoft Interview Questions

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 3. 07. 2024
  • One of the most important video for Amazon, Google and Microsoft interviews where we cover the cyclic sort algorithm and solve LeetCode easy till hard interview problems in the most easy to understand manner.
    Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!
    👉 Resources
    - Join Replit: join.replit.com/kunal-kushwaha
    - Complete Java DSA playlist: ‱ Java + DSA + Interview...
    - Code, Assignments, & Notes: github.com/kunal-kushwaha/DSA...
    âžĄïž Connect with me: kunalkushwaha.com
    =========================================
    Timestamps:
    00:00:00 Teaser
    00:00:08 Introduction
    00:01:10 Cyclic Sort
    00:04:26 Algorithm for Cyclic Sort
    00:10:09 Worst Case
    00:14:36 Code for Cyclic Sort
    00:21:06 Q1 : Missing Number
    00:37:56 Q2 : Find All Numbers Disappeared in an Array
    00:51:30 Q3 : Find the Duplicate Number
    01:04:15 Q4 : Find All Duplicates in an Array
    01:11:40 Q5 : Set Mismatch
    01:21:03 Q6 : First Missing Positive
    01:35:19 Outro
    #sorting #placement #dsa #interviews

Komentáƙe • 1,5K

  • @rakibmondal3151
    @rakibmondal3151 Pƙed 2 lety +352

    I purchased the geeks for geeks dsa self paced course .. that course is good but yrr this is gem i have started following ur course and just using this knowledge to solve questions there... Wish u came early my 3000 rs would be saved😔😌 please don't stop posting

    • @intellectualsrestroom2001
      @intellectualsrestroom2001 Pƙed 2 lety +6

      Hey @Rakib Mondal I was also thinking of buying the complete interview preparation course from geeks for geeks. After your experience with them what do you recommend?

    • @princhipawansaikia
      @princhipawansaikia Pƙed 2 lety +3

      Same bro..i also did same

    • @prasoonagrawal6072
      @prasoonagrawal6072 Pƙed 2 lety +6

      @@intellectualsrestroom2001 Don't take that

    • @hey_utkarshh
      @hey_utkarshh Pƙed 2 lety +9

      same .. i did the same. and after left it in the middle

    • @sudhanshugandhi6812
      @sudhanshugandhi6812 Pƙed 2 lety +2

      Have anyone purchase an Interview Preparation Course from Coding Ninja?

  • @_cricketshortsdaily_
    @_cricketshortsdaily_ Pƙed 2 lety +249

    Important Time Stamps for Future Revision
    4:05
    11:10
    16:30

  • @govindvarshney5116
    @govindvarshney5116 Pƙed 2 měsĂ­ci +13

    When Kunal say " ase he haua bna rakha hai" It motivates at another level

  • @1nvariant
    @1nvariant Pƙed 2 lety +243

    solving that hard leetcode problem by myself without seeing the solution was really motivating! Thanks for these videos!

    • @KunalKushwaha
      @KunalKushwaha  Pƙed 2 lety +53

      Great to hear!

    • @arjunnarayanasamy6317
      @arjunnarayanasamy6317 Pƙed 2 lety +14

      @@balibhadrasingh6730 Bro, cyclic sort will work if array contains 0 to N elements , means if arr.length = 4, it should have 0 to 4 but in any order, so you sort and find out which element is missing, it will not work for random numbers in an array

    • @manjindersingh8677
      @manjindersingh8677 Pƙed 2 lety +5

      @@arjunnarayanasamy6317 bro, did he covered Tree BFS, Graph BFS, Tree DFS, Graph DFS and Heap concepts in this Bootcamp?

    • @satyamshrivastav4347
      @satyamshrivastav4347 Pƙed 2 lety +2

      @@manjindersingh8677 nope

    • @chirayujain5872
      @chirayujain5872 Pƙed rokem +1

      @@manjindersingh8677 Not yet...Tree Data Structure is pending

  • @foodfashionmasti8297
    @foodfashionmasti8297 Pƙed 2 lety +78

    When he says " you will solve like this like this.. this is nothing . this course is more than enough to crack Amazon etc etc " I feel more confident 😭😭😭. Your real teacher ..huge respect to u .. đŸŒș

  • @himanshumaal1485
    @himanshumaal1485 Pƙed 2 lety +63

    In my life , this was the first time I did medium level question in just 1 minute . great videos .

  • @isi24.8
    @isi24.8 Pƙed rokem +18

    Kunal broke the "hard" question myth.. I solved that question before watching the answer and I was like "very simple stuff" .. Thank you Kunal for the effort you put into creating this bootcamp. I appreciate it 🙏

  • @BharatSingh-yg3ft
    @BharatSingh-yg3ft Pƙed 2 lety +7

    i never commented on any DSA video but after watching this video............the only one dialouge comes in mind .....
    Jahanpanah! Tussi great ho
Tohfa kabool karo!....jai ho

  • @mg5353
    @mg5353 Pƙed 2 lety +37

    I am not believe myself that after this video solved 2 hard leetcode questions.
    Thank you soo much for shocked me

    • @KunalKushwaha
      @KunalKushwaha  Pƙed 2 lety +8

      Keep up the good work!

    • @rakibmondal3151
      @rakibmondal3151 Pƙed 2 lety +1

      @@KunalKushwaha i m bca student can i apply for google or any other faang ?

  • @ankit_1012
    @ankit_1012 Pƙed 2 lety +99

    There's no single day.. When he doesn't uploads any video..
    Hats off to the great work bro..
    Just love the way you explain things in the most simplistic way..
    Thank you.. ❀

    • @KunalKushwaha
      @KunalKushwaha  Pƙed 2 lety +17

      Thank you 🙌

    • @pasito287
      @pasito287 Pƙed 2 lety +5

      @@KunalKushwaha which book do u prefer for java??

    • @developerdeepu6318
      @developerdeepu6318 Pƙed 2 lety +1

      @@KunalKushwaha Your explaination is far better than others. I am not writing this for any comparison but fact is fact. Noone can deny it.

    • @nikhilnaidu1383
      @nikhilnaidu1383 Pƙed 2 lety

      in Q2 if im swapping the elements inside while loop instead of creating a separate function for swap, it is showing TLE.....why?

    • @g_square3454
      @g_square3454 Pƙed 2 lety

      Really?

  • @SatyamGupta-nx4zj
    @SatyamGupta-nx4zj Pƙed 2 lety

    no one is teaching DSA in India like this.
    Great Work!

  • @dethia1220
    @dethia1220 Pƙed 7 měsĂ­ci

    Kunal, your teaching has been absolutely outstanding. I watched your explanation of the Cycle Sort algorithm from the beginning and, remarkably, I was able to solve all the questions without watching the LeetCode answers. Your guidance and support have been invaluable. Thank you for your exceptional teaching!

  • @deveshb793
    @deveshb793 Pƙed 2 lety +46

    After you explained the sorting algorithm the questions felt so easy even the leetcode hard as you said were not at all tough, thank you for making DSA easy for us Kunal bhai!🙌

    • @KunalKushwaha
      @KunalKushwaha  Pƙed 2 lety +8

      Great to hear!

    • @nikhilnaidu1383
      @nikhilnaidu1383 Pƙed 2 lety

      in Q2 if im swapping the elements inside while loop instead of creating a separate function for swap, it is showing TLE.....why?

    • @KumarSahil78
      @KumarSahil78 Pƙed 2 lety

      @@nikhilnaidu1383, I also did inside while loop, and it works fine, check again if you are doing something wrong

    • @sourin.majumdar
      @sourin.majumdar Pƙed rokem

      @@nikhilnaidu1383 did u do i++?

    • @rajarajan3911
      @rajarajan3911 Pƙed rokem

      @@KunalKushwaha can you kindly do videos on dp, graph, trees and complete the video :")

  • @arijitkumarpandab4232
    @arijitkumarpandab4232 Pƙed 2 lety +18

    Now. I am able to solve the questions just by seeing the question explanation and understanding the pattern. Thank you Kunal Bhai for these videos.

  • @manirDev
    @manirDev Pƙed rokem +3

    Before watching this video I almost solved all the problems which Kunal solves here by using the intuition method but after this video, I optimized them with the Cycle Sort algorithm and the time and space complexities have improved. Thanks for the hard work and your dedication.

  • @anuj.sharma13
    @anuj.sharma13 Pƙed 2 lety +2

    Best course ever. The way you teach the approach development and intuition. Next level stuff. Thanks very much

  • @sujalsamai6459
    @sujalsamai6459 Pƙed 2 lety +44

    Today I was solving one leetcode medium question, and after thinking for 10 seconds, I found that I have to just copy-paste insertion sort algorithm 😂 + no changes required. Literally hauwa bana rkha h
    Thank you Kunal For bringing this high quality content for free ❀

    • @VivekSingh-xk5rk
      @VivekSingh-xk5rk Pƙed 2 lety +1

      Leetcode kya hai?
      I am a beginner or will begin soon after joining college.
      Your college name please and your subject?

    • @kamleshpatel142
      @kamleshpatel142 Pƙed 2 lety

      @@VivekSingh-xk5rk hi

    • @g3189-x5d
      @g3189-x5d Pƙed 2 lety +3

      @@VivekSingh-xk5rk leetcode is a library of coding questions based on Data structures and algorithms.

  • @varunpusarla2590
    @varunpusarla2590 Pƙed 2 lety +8

    Thanks for this course. It's really the best course I've seen so far.

  • @S-Lifetips
    @S-Lifetips Pƙed 2 lety +3

    Literally i am falling in love💕💕💕 with your teaching skills and approaches you are showing to solve a problem. Though I am from non-IT background, working in IT but always very curious about coding with self learning. Your explanation is easily understandable by a non IT candidate too. Keep up the good work. Hope to see much more videos on the various cutting edge technologies going forward. You are helping people👏👏👏👏 rather doing videos for views/monetary benefit. Keep sharing your knowledge. Because it is the most prestigious thing one can do without any selfishness. Thanks

  • @AnkitKumar-ow6fg
    @AnkitKumar-ow6fg Pƙed rokem

    I just love how this guy has burst the FANG bubble. Freshers really needed to know this.

  • @rosansen2858
    @rosansen2858 Pƙed 2 lety +3

    last question was like " jo dikhta hain woh hota nahin aur jo hota hain woh dikhta nahin" . Superb session.loved it.

  • @nidhirani8559
    @nidhirani8559 Pƙed 2 lety +47

    today I completed previous assignments.Really enjoying doing practice after theory. Thank you so much for making such a grt content and providing questions for practice after theory.

    • @lokesh5371
      @lokesh5371 Pƙed 2 lety +2

      Hey nidhi , I am also following Kunal bhaiya but I am getting some problems and unable to solve some assignment questions so how did you managed with this issue ?

    • @cdrrjt5005
      @cdrrjt5005 Pƙed 2 lety +2

      @@lokesh5371 same problem here I am not able to solve assignment question. They use other data structures and algorithms to solve those questions.

    • @lokesh5371
      @lokesh5371 Pƙed 2 lety +1

      @@cdrrjt5005 I hope Kunal bhaiya reply to this :)

    • @nidhirani8559
      @nidhirani8559 Pƙed 2 lety +4

      @@lokesh5371 I am also getting stucked in 4-5 problems even not solved yet,add those problems to your list and try it after some time with fresh mind.

    • @_cricketshortsdaily_
      @_cricketshortsdaily_ Pƙed 2 lety +4

      Hey guys can we have a small group, so we can interact with each other regarding doubts and any conceptual take away ? Discord community is great but if we will have a smaller group i think it will be more beneficial as we are at the same point know. Will love to here your opinion on this 🙌

  • @rahuldatta1382
    @rahuldatta1382 Pƙed rokem

    i have never seen anyone before like you,you are just amazing

  • @j.anchanajegath7823
    @j.anchanajegath7823 Pƙed rokem

    Your words keeps me going. Thank god i found ur dsa playlist

  • @1Bipul
    @1Bipul Pƙed 2 lety +6

    As always Awesome 💞
    Actually this is the best DSA course ever in CZcams ❀
    Thank u Kunal 🙏

  • @hunortotbagi
    @hunortotbagi Pƙed rokem +12

    I have a simple solution to Q1 Missing Number but it doesn't use the Cyclic sort algorithm. Since you know N you can use the formula N*(N+1)/2 to get the sum if the array would contain the missing number, than just sum up the given array and subtract them.
    Also would like to thank Kunal for amazing course so far! Enjoying it really :)

    • @RONAKSINHA-yh8kc
      @RONAKSINHA-yh8kc Pƙed rokem

      That is a very interesting solution. Thank you

    • @KRiSH-ei6fy
      @KRiSH-ei6fy Pƙed rokem +3

      Even I had similar thinking. But if the missing numbers are more than 1, this approach won't work. Whereas cyclic sort approach works very well in all conditions!

    • @rushabhshah6373
      @rushabhshah6373 Pƙed rokem

      Binary search is good

    • @CodingAtti
      @CodingAtti Pƙed 6 měsĂ­ci

      @@KRiSH-ei6fy there will be only one missing number since the array size is N. But in some other cases like duplicates question cyclic is best.

  • @vivekkhatri1759
    @vivekkhatri1759 Pƙed 2 lety

    Best boot camp i have come across on the youtube, thank you soo much Kunal.

  • @jayvardhanparkar8307
    @jayvardhanparkar8307 Pƙed 2 lety +1

    Best Course Ever !! Kunal Bhaiya Op !!

  • @g3189-x5d
    @g3189-x5d Pƙed 2 lety +21

    The best way to teach something is getting clarity in a concept and doing 5-6 similar questions to reinforce it. This course does that. Great!!!

    • @KunalKushwaha
      @KunalKushwaha  Pƙed 2 lety +7

      Glad it was helpful!

    • @nikhilnaidu1383
      @nikhilnaidu1383 Pƙed 2 lety

      in Q2 if im swapping the elements inside while loop instead of creating a separate function for swap, it is showing TLE.....why?

    • @balibhadrasingh6730
      @balibhadrasingh6730 Pƙed 2 lety

      cyclic sort is not working for arr[] = {20,10,6,18,17,33}, how it will work for this array acoording to kunal shah concept
      do you know

    • @subhamchoudhury8363
      @subhamchoudhury8363 Pƙed 2 lety

      @@balibhadrasingh6730 Cyclic sort only works for 0 to N element

    • @jaxsriv1052
      @jaxsriv1052 Pƙed rokem +1

      @@balibhadrasingh6730 it works only in the range of 0 to N or 1 to N, your array doesn't have elements in b/w that pattern

  • @_AMODINIMOHOD
    @_AMODINIMOHOD Pƙed 2 lety +10

    THIS IS BEST JAVA COURSE TILL DATE ,understood all the concepts taught , Was able to solve a medium question from assignments soooo easily! Rather than jumping on to complex solutions go for this video it has helped me a lot to build logic to solve questions.

  • @geetankarkarmakar378
    @geetankarkarmakar378 Pƙed 2 lety

    The best explanation for cyclic sort so far. Hats off to the good work you are doing. Thank You !

  • @duttulurihitheshkumar4800
    @duttulurihitheshkumar4800 Pƙed rokem +1

    Thank you for your efforts Kunal. I haven't seen a video where people go through each iteration in a loop with patience just to explain how it is working and most of them won't even type the code in live and they just give the code at the end after explaining the algorithm. I hope you complete this when you get time. I have seen every in this playlist even if I know the fundamentals because you covered some topics I forgot and missed when I learnt the basics. I graduated in 2019 and I am currently working in a mass hiring company for sh*t salary and I am trying to make the shift. This bootcamp is really amazing and I know you know that too. Please complete when you have time. Thank you.

  • @MohammadAli-jo3mp
    @MohammadAli-jo3mp Pƙed 2 lety +12

    Thank you bro for uploading such an awesome content, it will help many students who didn't afford to buy the expensive courses to study.

  • @jashanbansal2613
    @jashanbansal2613 Pƙed 2 lety +7

    "Minimum swaps to sort an array of distinct elements"
    Solved this one also using cycle sort. This question is great one, everyone must try it

    • @AdritoDey
      @AdritoDey Pƙed 2 lety

      Hey can you share your code for this question?
      I couldn't come up with a O(n) time and constant space solution!

    • @jashanbansal2613
      @jashanbansal2613 Pƙed 2 lety

      @@AdritoDey create a vector of pairs with first as array value, second as index. Now just sort this array according to first value. Now u just have to take every index value to its original position using swaps, that's what we do in cycle sort.

    • @helpinghandskurnool7750
      @helpinghandskurnool7750 Pƙed 11 měsĂ­ci

      Yeah

  • @utkarshsinghal5011
    @utkarshsinghal5011 Pƙed 2 lety

    Best dsa course cycle sort is now crystal clear too.

  • @azeemkhan-nh1ou
    @azeemkhan-nh1ou Pƙed 7 měsĂ­ci

    Genuinely the best Dsa course I came across..

  • @giridharanias7567
    @giridharanias7567 Pƙed rokem +2

    thalaiva nee vera level đŸ€©đŸ€©đŸ€©

  • @pradeepraok4435
    @pradeepraok4435 Pƙed 2 lety +3

    It feels nice to solve problems of cyclic and the way you teach is awesome . This course is addictive/habit forming for solving problems.

  • @mitulchavda9941
    @mitulchavda9941 Pƙed 2 lety +2

    Today i solved a hard problem cos of you. Thanks man for this wonderful bootcamp.

  • @abhirajxyz7944
    @abhirajxyz7944 Pƙed 5 měsĂ­ci +1

    I have watched lots of DSA videos on youtube but No one can give logic building like this and littery I am very thankful to my friend who suggested me this playlist

  • @ananyagupta1330
    @ananyagupta1330 Pƙed 2 lety +4

    Thanks a lot for this video .Was able to code every single question on my own .Undoubtedly the best DSA bootcamp .🙌🙌

  • @piyushsaxena6243
    @piyushsaxena6243 Pƙed 2 lety +5

    Bro please keep uploading such videos,thanks a lot,please bring such new and hard interview problems on regular basis💓💓

  • @Shadowxgaming_
    @Shadowxgaming_ Pƙed 2 lety

    best teaching video for coding , till then i have watched numerous channels but because of u i am now able to understand how to actually do it . a hearty thanks brother

  • @AnubhavMadhav
    @AnubhavMadhav Pƙed rokem +1

    Grateful for Kunal Kushwaha, what a great man!✹💯

  • @saihemanthnukala6087
    @saihemanthnukala6087 Pƙed 2 lety +7

    The way you have been explained is phenomenal! Keep going brother :)

  • @vishrudhraj6272
    @vishrudhraj6272 Pƙed rokem +12

    Kunal, in Q3: It was mentioned that nums shouldn't be modified right? But Cyclic sort modifies nums.
    Love the way you teach bh the way❀

    • @sreeramreddyvelagala6952
      @sreeramreddyvelagala6952 Pƙed rokem

      You can use indexOf() method also, you don't have to modify the array using this

    • @sourin.majumdar
      @sourin.majumdar Pƙed rokem +1

      Constraints aside, he's showing how you can apply this algorithm to this problem. Then when the interviewer would ask to do it without modification, you have to move to another approach. For that you can watch Striver's video for this problem.

  • @adityalingwal6029
    @adityalingwal6029 Pƙed 3 měsĂ­ci +1

    For the first time I was able to solve a Leetcode question and that too without taking a hint or looking at the solution/explanation. It felt amazing. This playlist is nothing short of amazing.

  • @zzdar4117
    @zzdar4117 Pƙed rokem

    Never ever I thought I would be able solve a leetcode hard problem this quick. Great job Kunal !🌟

  • @aniketpurohit8613
    @aniketpurohit8613 Pƙed 2 lety +5

    This is literally a gold mine! I code my solutions in python and these are helping me immensely. Keep up the good work!

    • @KunalKushwaha
      @KunalKushwaha  Pƙed 2 lety +4

      Great to hear!

    • @vamsiakula653
      @vamsiakula653 Pƙed 2 lety +1

      Your comment made my day.

    • @nikhilnaidu1383
      @nikhilnaidu1383 Pƙed 2 lety +1

      in Q2 if im swapping the elements inside while loop instead of creating a separate function for swap, it is showing TLE.....why?

    • @balibhadrasingh6730
      @balibhadrasingh6730 Pƙed 2 lety

      cyclic sort is not working for arr[] = {20,10,6,18,17,33}, how it will work for this array acoording to kunal shah concept
      do you know

  • @haswanth_kumar17
    @haswanth_kumar17 Pƙed rokem +3

    //this code will be helpfull to understand the algorithm in an efficient way
    //great work kunal anna
    class Main
    {
    static void cyclicSort(int[] nums)
    {
    int i=0;
    while(i

  • @rishabhneogi
    @rishabhneogi Pƙed rokem

    I can see my progress! Thank you Kunal

  • @Helly_Patel
    @Helly_Patel Pƙed 2 lety +4

    Thanks for teaching us like no one did till now!! One small request, please make lectures on dynamic programming as well!!

    • @CineSavvySoul
      @CineSavvySoul Pƙed 2 lety

      should be a high request. without having proper knowledge of each concepts how u suppose to crack interview.

  • @aritrachatterjee147
    @aritrachatterjee147 Pƙed 2 lety +4

    Just finished the previous assignment today and was thinking when the next video will come and then your notification popped up , man you are hearing mind or what❀

    • @mehandiWithPrity
      @mehandiWithPrity Pƙed 2 lety

      Bhaiya... I got stuck in many problems while solving... How do u manage all the problem!?
      Have u solved all the prblms or some good questios only!?

    • @aritrachatterjee147
      @aritrachatterjee147 Pƙed 2 lety

      @@mehandiWithPrity hey can u write the questions which you got stuck and regarding me I was doing the questions given by Kunal as well as some prblms in that specific topic on hackerrank

  • @abhamayeemahanta3276
    @abhamayeemahanta3276 Pƙed rokem

    I am impressed by seeing your video. Now the problems look so easy.

  • @vipulpandey682
    @vipulpandey682 Pƙed 2 lety +16

    I am a BCA student and I never thought I can solve this type of questions but after watching your bootcamp JAVA&DSA my reaction to FAANGM, u're kidding me you asked so easy questions in your Coding Interview now I am also able to solve those problems
    So Thankyou Kunal Bhaiya or Sir because You have all the qualities and again Thank you for giving us valuable knowledge
    Thankyou

    • @CineSavvySoul
      @CineSavvySoul Pƙed 2 lety +1

      if u r able to solve the questions ,it doesn't mean those are easy problems. Its ur problem solving skills

    • @kirtisinha2000
      @kirtisinha2000 Pƙed rokem

      It means u are working at faang. Companies??

  • @TrendingTwills
    @TrendingTwills Pƙed 2 lety +5

    Nice work @kunal, not only upcoming college grads but it's helping experienced one like me in clearing my basics(ps: working as R&D Engineer in a leading MNC)

  • @gulzhasmailybayeva4587
    @gulzhasmailybayeva4587 Pƙed 7 měsĂ­ci

    Thank you Kunal! Love your channel and teaching style. Love from Kazakhstan!

  • @subhamghosh5335
    @subhamghosh5335 Pƙed 2 lety

    Best lecture to learn Cyclic Sort!!

  • @geek4040
    @geek4040 Pƙed 2 lety +6

    I'm still at 17:50, but I think we can write it better. The code is in C++
    void sortArr( vector &arr)
    {
    for(auto i = 0; i < arr.size(); i++)
    {
    while(arr[i] != i+1)
    {
    swap(arr[i], arr[arr[i]-1]);
    }
    }
    }

    • @anonblock7260
      @anonblock7260 Pƙed 2 lety +1

      I did the same way, but I felt his way was better as there's a only one loop making it easier to read (though the complexity is the same). Why do you feel this is better?

  • @smilingstarsomu975
    @smilingstarsomu975 Pƙed 2 lety +5

    I did Q3 in little bit different by using previous method
    Q3: Duplicate number
    Input: a[ ]={3,4,1,2,2}
    First sort by cyclic sort
    Then it becomes
    a[ ]={1,2,3,4,2}
    Then
    Sop(a.length-1)
    Tq you kunal

  • @rohithramesh5514
    @rohithramesh5514 Pƙed rokem

    Thank you Kunal for this. I could never believe myself solving the medium and hard questions in just a snap just by following the understanding pattern as you are teaching. Kudos to you 🙌

  • @Krishna_Consious
    @Krishna_Consious Pƙed 9 měsĂ­ci

    U R SUCH A GREAT FRIEND THAT EVERY AVERAGE STUDENT WISH TO HAVE.

  • @anshrohatgi8602
    @anshrohatgi8602 Pƙed 2 lety +5

    Never learned such things in deep

  • @surajpr2521
    @surajpr2521 Pƙed 2 lety +22

    For find duplicates, you cant use Cyclic Sort as the question clearly says we should not modify existing array.

    • @prettylilnerdy6802
      @prettylilnerdy6802 Pƙed 2 lety +3

      wondering same

    • @eldavimost
      @eldavimost Pƙed 2 lety +1

      @@prettylilnerdy6802 Same here. Maybe they don't let you modify the values but they do let you sort it :)

    • @mukul-kr
      @mukul-kr Pƙed 2 lety +1

      don't know about multiple duplicates but if it is a single duplicate we can just xor whole array and the result will be answer

    • @eldavimost
      @eldavimost Pƙed 2 lety

      @@mukul-kr you need to xor the whole array, then xor that with all the numbers that should be in 1..n, no?

    • @balakrishnanr648
      @balakrishnanr648 Pƙed 2 lety

      Yeah same I wonder, I think XOR can be used for that Ques, as we are modifying the array by sorting it.

  • @ayeshakhatun6216
    @ayeshakhatun6216 Pƙed rokem +1

    Thankyou soo much for making this bootcamp . Never found this kind of teaching in any other channel . Love the way you explain n make problem solving fun . Really appreciate your effort . Would be very glad to see more such videos. ❀❀❀

  • @dannymukash4982
    @dannymukash4982 Pƙed rokem

    Great thanks for motivation. When u say that everything is easy and SHOW it, it makes me a lot confident! Thank u very much

  • @jashanbansal2613
    @jashanbansal2613 Pƙed 2 lety +7

    Great Man :)
    I have been consistently doing leetcode for more than 40 days now, but still this one is quite new and very interesting for me. Keep up the good work :)

  • @ayushranjan3014
    @ayushranjan3014 Pƙed 2 lety +5

    I feel the missing number question can be solved by simply addition property, and maybe that might be slightly better.

  • @sarveshpatel492
    @sarveshpatel492 Pƙed 9 měsĂ­ci

    This course is so much better that every other course, It is like I am getting a therapy and also getting educated, the satisfaction on completing the question on my own is the best feeling. Thankyou so much.

  • @2WIICE
    @2WIICE Pƙed 2 lety +3

    Hey! I have a question regarding programming language used. I am familiar with Python, will that be a problem for understanding this course as it is in Java?
    Keep up the good work Kunal ♄

    • @rohitchitte5614
      @rohitchitte5614 Pƙed rokem

      Yes you can implemet solutions in python as well , just understanding logic is important part which u can comprehend with these videos.

  • @vaishaligentyal1777
    @vaishaligentyal1777 Pƙed rokem +7

    hey Kunal your videos are great I can solve medium to hard-level questions of LeetCode đŸ„°, but the playlist is incomplete can you please provide the remaining topics such as DP, trees, and graphs it really helpful if you continue this playlistđŸ„ș.

    • @vansh9857
      @vansh9857 Pƙed rokem

      He's too busy for that

    • @superfax
      @superfax Pƙed rokem

      @@vansh9857 Now he is working on it again!!

  • @kartik-k
    @kartik-k Pƙed rokem

    submitted first leetcode solution by myself, thanks man. Keep up the great work.

  • @Raghuveer2798
    @Raghuveer2798 Pƙed rokem

    Thank you for giving me the pleasure of solving a LeetCode hard question on my own.

  • @srivardhan.s5191
    @srivardhan.s5191 Pƙed 5 měsĂ­ci +4

    at 52:30 , the question wants us to solve the problem without changing the array. But why does he use cycle sort then, it changes the arr. ????

  • @shubhamgoswami8751
    @shubhamgoswami8751 Pƙed 2 lety +5

    Upload accordingly to u ....not fast becouse quality is more important ...don't listen to anyone please

  • @ArynKr
    @ArynKr Pƙed 2 lety

    Best course ever made for DSA.

  • @shreya6676
    @shreya6676 Pƙed 2 lety +1

    Thanku so much ...
    Upon completing the whole video...gave me a lot of confidence!!
    Thanks a lot

  • @laugh_till_u_pee968
    @laugh_till_u_pee968 Pƙed 2 lety +4

    is it only me or every one can see suryanshu tomar's comment is older than the video itself? for me its showing 24 minutes

    • @KunalKushwaha
      @KunalKushwaha  Pƙed 2 lety +2

      because videos are uploaded very early and published later. hence people can see those directly from playlist.

    • @laugh_till_u_pee968
      @laugh_till_u_pee968 Pƙed 2 lety

      @@KunalKushwaha oh so no magic thats sad. bye gotta go, i have to wait in playlist section.

    • @live_mocha
      @live_mocha Pƙed 2 lety

      I don't understand why do people care about such irrelevant things. Just focus on learning my friend. These type of questions won't get you anywhere.

  • @srikanthmacha7990
    @srikanthmacha7990 Pƙed 2 lety +5

    can't we do
    if(arr[i] != i+1)
    arr[i] = i+1;
    for every element in array?

    • @live_mocha
      @live_mocha Pƙed 2 lety

      Not always. What if the numbers in the array are not consecutive? Something like [4,6,9,2]. Think about it.

    • @srikanthmacha7990
      @srikanthmacha7990 Pƙed 2 lety

      @@live_mocha then cyclic sort won't be applied to that array .... It applies for consecutive numbers only

    • @live_mocha
      @live_mocha Pƙed 2 lety

      @@srikanthmacha7990 That's only one case, I found many examples where cycle sort is used for non consecutive elements. The correct position for an element is not i+1 in every case. It is the number of elements lesser than the current plus one.

  • @aashashanmugam
    @aashashanmugam Pƙed rokem

    Outstanding explanation on cycle sort!! Thank you Kunal!

  • @pawanyadav4024
    @pawanyadav4024 Pƙed 18 dny

    the guidance is amazing, couldnt get impressed more, i have even started solving questions without even going through complete video.
    👍👍👍👍👍

  • @snehaverma8109
    @snehaverma8109 Pƙed 2 lety

    Love this boot-camp series :)

  • @AdityaSharma-er3gs
    @AdityaSharma-er3gs Pƙed rokem

    thank you so much kunal, this course is boosting my confidence and please continue this course.

  • @fromhousesheoran
    @fromhousesheoran Pƙed 5 měsĂ­ci

    love you man, finally solving some problem

  • @hemilfichadia7234
    @hemilfichadia7234 Pƙed rokem

    Mostly, the things are categorized according to its benefits but sometimes somethings just sets a reference to be a league of its own and I am glad to say that this playlist is the one of its kind and just great.

  • @saikrishna-cy2tr
    @saikrishna-cy2tr Pƙed 2 lety

    one of the best course i ever watched for java&Dsa (kunal sir is changing my life in better way)

  • @akashyadagouda896
    @akashyadagouda896 Pƙed 2 lety

    This is next level of teaching ....
    Thanks bro

  • @anuragmalhotra2855
    @anuragmalhotra2855 Pƙed 2 lety

    Wonderful.. No more words to explain this video, just Wonderful ..

  • @tarangsharma5601
    @tarangsharma5601 Pƙed 2 lety +1

    Please keep doing this great work , coz I see a lot of people aiming at you ,and just want to discourage you , but you are putting up amazing content , please keep doing it for us ...thanks

  • @ogungbemioluwamayowa658
    @ogungbemioluwamayowa658 Pƙed rokem

    I solved Q2, Q3 and Q4 by myself. Just from the explanations from the video. My confidence as a programmer has literally sky rocketed. Thanks

  • @carrielii7239
    @carrielii7239 Pƙed rokem

    I've watched it again. Still feel it's the best algo video I've ever seen! Thanks a bunch Kunal!!!

  • @drishtisaraf8357
    @drishtisaraf8357 Pƙed rokem

    I loved this video. I solved and submitted all that questions by myself. It feels so good. I don't think I would ever forget this concept.

  • @sarthakyadav9950
    @sarthakyadav9950 Pƙed 2 lety +1

    I watched the working of cyclic sort and solved every question mentioned in the video myself. After solving that one hard question cyclic sort became crystal clear to me. Thanks Man!!!❀❀

  • @aryanarora5411
    @aryanarora5411 Pƙed 10 měsĂ­ci

    I am glad that I found your channel sir. you just cleared my concepts that I was never able to understand the logic behind them. HUGE RESPECT TO YOU SIR❀❀

  • @kennettemaddela5682
    @kennettemaddela5682 Pƙed rokem

    You humble me. Thank you very much!

  • @orvildsilva6577
    @orvildsilva6577 Pƙed 2 lety

    Thank you kunal for making these amazing videos 🙌🙌

  • @parthrastogi5909
    @parthrastogi5909 Pƙed rokem

    Hats off to you man....the way you explain every questions looks like very easy

  • @tusharbhattvlogs4185
    @tusharbhattvlogs4185 Pƙed 10 měsĂ­ci

    Great Kunal 😃 One of the best DSA series.

  • @logequats
    @logequats Pƙed 2 lety

    Before, i used to memorize the problems. But now i am memorizing the patterns and that's a game changer, thanks kunal.

  • @clomose5740
    @clomose5740 Pƙed 10 měsĂ­ci +1

    Now I got confidence in cycle sort, thanks bhai