Cycle Sort - Amazon, Google, Microsoft Interview Questions

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ย. 2024

ความคิดเห็น • 1.7K

  • @KunalKushwaha
    @KunalKushwaha  3 หลายเดือนก่อน +9

    DSA + interview preparation playlist: th-cam.com/play/PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ.html

  • @govindvarshney5116
    @govindvarshney5116 7 หลายเดือนก่อน +45

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

  • @1nvariant
    @1nvariant 3 ปีที่แล้ว +286

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

    • @KunalKushwaha
      @KunalKushwaha  3 ปีที่แล้ว +59

      Great to hear!

    • @arjunnarayanasamy6317
      @arjunnarayanasamy6317 2 ปีที่แล้ว +15

      @@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 2 ปีที่แล้ว +5

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

    • @satyamshrivastav4347
      @satyamshrivastav4347 2 ปีที่แล้ว +2

      @@manjindersingh8677 nope

    • @chirayujain5872
      @chirayujain5872 2 ปีที่แล้ว +1

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

  • @_cricketshortsdaily_
    @_cricketshortsdaily_ 3 ปีที่แล้ว +271

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

  • @foodfashionmasti8297
    @foodfashionmasti8297 3 ปีที่แล้ว +89

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

    • @merc.5802
      @merc.5802 ปีที่แล้ว +3

      where did you reach?

    • @zunnorainshah3356
      @zunnorainshah3356 11 หลายเดือนก่อน +2

      hahaha love Kunal's vibes

  • @rakibmondal3151
    @rakibmondal3151 3 ปีที่แล้ว +368

    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 3 ปีที่แล้ว +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 3 ปีที่แล้ว +3

      Same bro..i also did same

    • @prasoonagrawal6072
      @prasoonagrawal6072 3 ปีที่แล้ว +6

      @@intellectualsrestroom2001 Don't take that

    • @heyutkarshhh
      @heyutkarshhh 3 ปีที่แล้ว +9

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

    • @sudhanshugandhi6812
      @sudhanshugandhi6812 3 ปีที่แล้ว +2

      Have anyone purchase an Interview Preparation Course from Coding Ninja?

  • @himanshumaal1485
    @himanshumaal1485 2 ปีที่แล้ว +80

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

  • @isi24.8
    @isi24.8 ปีที่แล้ว +22

    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 🙏

  • @abhirajxyz7944
    @abhirajxyz7944 9 หลายเดือนก่อน +3

    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

  • @BharatSingh-yg3ft
    @BharatSingh-yg3ft 3 ปีที่แล้ว +11

    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

  • @manirDev
    @manirDev ปีที่แล้ว +6

    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.

  • @ankit_1012
    @ankit_1012 3 ปีที่แล้ว +106

    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  3 ปีที่แล้ว +17

      Thank you 🙌

    • @pasito287
      @pasito287 3 ปีที่แล้ว +5

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

    • @developerdeepu6318
      @developerdeepu6318 3 ปีที่แล้ว +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 2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      Really?

  • @muhammadfahad4782
    @muhammadfahad4782 หลายเดือนก่อน +1

    I just wanted to personally thank you for the incredible work you’re doing on TH-cam. Your DSA playlist has been a game-changer for me, and I’m sure for many others. Your way of explaining complex topics in such a simple and engaging manner is truly impressive. I’ve recommended your channel to many people who are struggling with DSA.
    Thanks again for all your efforts - you’re making a real difference!

  • @mg5353
    @mg5353 3 ปีที่แล้ว +41

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

    • @KunalKushwaha
      @KunalKushwaha  3 ปีที่แล้ว +8

      Keep up the good work!

    • @rakibmondal3151
      @rakibmondal3151 3 ปีที่แล้ว +1

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

  • @bindubeesetti8732
    @bindubeesetti8732 3 หลายเดือนก่อน +1

    you are absolute a true gem. No course does the explanation as good as you. Please continue to teach concepts like this and then one day when it reaches to every student, India would be the next silicon valley with all the gems into it

  • @deveshb793
    @deveshb793 3 ปีที่แล้ว +50

    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  3 ปีที่แล้ว +8

      Great to hear!

    • @nikhilnaidu1383
      @nikhilnaidu1383 2 ปีที่แล้ว

      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 2 ปีที่แล้ว

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

    • @sourin.majumdar
      @sourin.majumdar ปีที่แล้ว

      @@nikhilnaidu1383 did u do i++?

    • @rajarajan3911
      @rajarajan3911 ปีที่แล้ว

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

  • @adityalingwal6029
    @adityalingwal6029 8 หลายเดือนก่อน +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.

  • @2858rssaam
    @2858rssaam 3 ปีที่แล้ว +5

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

  • @ShortBits786
    @ShortBits786 3 หลายเดือนก่อน

    I have solved medium question in 5 min I only change this
    for (index in nums.indices){
    if (nums[index] != index+1){
    return nums[index]
    }
    } .
    Thank you kunal sir

  • @arijitkumarpandab4232
    @arijitkumarpandab4232 3 ปีที่แล้ว +20

    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.

    • @VivekSingh-xk5rk
      @VivekSingh-xk5rk 3 ปีที่แล้ว

      Tumahara college name and where are you from?

    • @Kj89865
      @Kj89865 4 หลายเดือนก่อน

      bhai konsi company me lagi

  • @nomanrauf9429
    @nomanrauf9429 13 วันที่ผ่านมา

    You are just not teaching. You also increase the confidence of students and motivate us.

  • @hunortotbagi
    @hunortotbagi ปีที่แล้ว +14

    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 ปีที่แล้ว

      That is a very interesting solution. Thank you

    • @KRiSH-ei6fy
      @KRiSH-ei6fy ปีที่แล้ว +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 ปีที่แล้ว

      Binary search is good

    • @CodingAtti
      @CodingAtti 11 หลายเดือนก่อน +1

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

  • @_AMODINIMOHOD
    @_AMODINIMOHOD 3 ปีที่แล้ว +12

    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.

  • @g3189-x5d
    @g3189-x5d 3 ปีที่แล้ว +23

    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  3 ปีที่แล้ว +7

      Glad it was helpful!

    • @nikhilnaidu1383
      @nikhilnaidu1383 2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      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 2 ปีที่แล้ว

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

    • @jaxsriv1052
      @jaxsriv1052 2 ปีที่แล้ว +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

  • @gilfoyle2211
    @gilfoyle2211 2 ปีที่แล้ว +1

    Dekho ek question, solve baaki ke apne aap!
    Watch one, solve all!
    Thank you Kunal for making it so easy for us to understand! Kudos!

  • @nidhirani8559
    @nidhirani8559 3 ปีที่แล้ว +48

    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 3 ปีที่แล้ว +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 3 ปีที่แล้ว +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 3 ปีที่แล้ว +1

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

    • @nidhirani8559
      @nidhirani8559 3 ปีที่แล้ว +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_ 3 ปีที่แล้ว +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 🙌

  • @Gayatrinallamilli-n1t
    @Gayatrinallamilli-n1t 2 วันที่ผ่านมา

    Best DSA bootcamp i have ever seen!!!!!!!!!!!!!!!!!!!

  • @PROTECHRAHUL
    @PROTECHRAHUL 2 ปีที่แล้ว +3

    Kunal introduced me with the cyclic sort n i beated all the questions by myself.
    Great work bhai.

  • @shubhampratapsingh6189
    @shubhampratapsingh6189 2 ปีที่แล้ว +1

    I have been following your content from over a month now. Really have enjoyed your teaching style.

  • @jashanbansal2613
    @jashanbansal2613 3 ปีที่แล้ว +8

    "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 3 ปีที่แล้ว

      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 3 ปีที่แล้ว

      @@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 ปีที่แล้ว

      Yeah

  • @duttulurihitheshkumar4800
    @duttulurihitheshkumar4800 2 ปีที่แล้ว +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.

  • @sujalsamai6459
    @sujalsamai6459 3 ปีที่แล้ว +48

    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 3 ปีที่แล้ว +1

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

    • @kamleshpatel142
      @kamleshpatel142 3 ปีที่แล้ว

      @@VivekSingh-xk5rk hi

    • @g3189-x5d
      @g3189-x5d 3 ปีที่แล้ว +3

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

  • @AnkitKumar-ow6fg
    @AnkitKumar-ow6fg 2 ปีที่แล้ว

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

  • @varunpusarla
    @varunpusarla 3 ปีที่แล้ว +8

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

  • @ezsnippet_09
    @ezsnippet_09 5 หลายเดือนก่อน

    at 14:28 the confidence you gave time by time is really like no one encourage like this in their videos, lots of love.

  • @Entertainmentvideo23508
    @Entertainmentvideo23508 3 หลายเดือนก่อน +3

    Great learning platform that i ever seen 🎉😊.....you are really brilliant 😍 one of the best playlist for DSA.I really like your all contents..... Thank you so much ❤️🎉❤

  • @dethia1220
    @dethia1220 11 หลายเดือนก่อน

    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!

  • @MohammadAli-jo3mp
    @MohammadAli-jo3mp 3 ปีที่แล้ว +13

    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.

  • @SatyamGupta-nx4zj
    @SatyamGupta-nx4zj 2 ปีที่แล้ว

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

  • @S-Lifetips
    @S-Lifetips 2 ปีที่แล้ว +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

  • @Krishna_Consious
    @Krishna_Consious ปีที่แล้ว

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

  • @saihemanthnukala6087
    @saihemanthnukala6087 3 ปีที่แล้ว +7

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

  • @jayvardhanparkar8307
    @jayvardhanparkar8307 2 ปีที่แล้ว +1

    Best Course Ever !! Kunal Bhaiya Op !!

  • @1Bipul
    @1Bipul 3 ปีที่แล้ว +6

    As always Awesome 💞
    Actually this is the best DSA course ever in TH-cam ❤️
    Thank u Kunal 🙏

  • @aryanparishwad24
    @aryanparishwad24 10 หลายเดือนก่อน

    Education should always be free for everyone as you endorse and simplified like you teach

  • @ananyagupta1330
    @ananyagupta1330 3 ปีที่แล้ว +4

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

  • @azeemkhan-nh1ou
    @azeemkhan-nh1ou 11 หลายเดือนก่อน

    Genuinely the best Dsa course I came across..

  • @pradeepraok4435
    @pradeepraok4435 2 ปีที่แล้ว +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.

    • @Rajesh-mj2uv
      @Rajesh-mj2uv 2 ปีที่แล้ว

      Yes bro. Absolutely true

  • @lightyagami2906
    @lightyagami2906 ปีที่แล้ว

    we are lucky enough to have you as a big brother who directs us in the right way
    May bhagwaan give you all the strength needed to you
    thank you really

  • @aniketpurohit8613
    @aniketpurohit8613 3 ปีที่แล้ว +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  3 ปีที่แล้ว +4

      Great to hear!

    • @vamsiakula653
      @vamsiakula653 3 ปีที่แล้ว +1

      Your comment made my day.

    • @nikhilnaidu1383
      @nikhilnaidu1383 2 ปีที่แล้ว +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 2 ปีที่แล้ว

      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

  • @piyushsaxena6243
    @piyushsaxena6243 3 ปีที่แล้ว +5

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

    • @KunalKushwaha
      @KunalKushwaha  3 ปีที่แล้ว +1

      I will cover it completely dont worry

  • @k23raj2
    @k23raj2 ปีที่แล้ว

    Right person to write "Head First Data Structure" Book. Thanks Kunal , Happy Coding

  • @Helly_Patel
    @Helly_Patel 2 ปีที่แล้ว +4

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

    • @CineSavvySoul
      @CineSavvySoul 2 ปีที่แล้ว

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

  • @AnubhavMadhav
    @AnubhavMadhav 2 ปีที่แล้ว +1

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

  • @aritrachatterjee147
    @aritrachatterjee147 3 ปีที่แล้ว +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 3 ปีที่แล้ว

      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 3 ปีที่แล้ว

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

  • @rameshwarmangal3971
    @rameshwarmangal3971 3 หลายเดือนก่อน

    What a playlist Kunnal bhaiyaa..Best dsa playlist of utube.Can beat any paid courses.

  • @Shadowxgaming_
    @Shadowxgaming_ 2 ปีที่แล้ว

    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

  • @TrendingTwills
    @TrendingTwills 3 ปีที่แล้ว +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)

  • @Surajshorts223
    @Surajshorts223 8 หลายเดือนก่อน +1

    I am literally attached with this playlist..What a Stuff from you Kunal Bhaiya👌👌👌👌

  • @haswanth_kumar17
    @haswanth_kumar17 2 ปีที่แล้ว +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

  • @MansiNaxine
    @MansiNaxine 3 หลายเดือนก่อน

    Thank you so much for clearing all doubts so smoothly and giving explaination to every single thing!

  • @jashanbansal2613
    @jashanbansal2613 3 ปีที่แล้ว +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 :)

  • @aradhyapatro3796
    @aradhyapatro3796 3 ปีที่แล้ว +2

    Explanation was so nice that I coded the cyclic sort without even watching @kunal ❤️ code it in video .

  • @smilingstarsomu975
    @smilingstarsomu975 2 ปีที่แล้ว +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

  • @advrakshachaudhari3699
    @advrakshachaudhari3699 ปีที่แล้ว +1

    wow i just solved questions within 10 seconds with your way KUNAL !!!

  • @geek4040
    @geek4040 3 ปีที่แล้ว +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 3 ปีที่แล้ว +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?

  • @vaibhavsingh3166
    @vaibhavsingh3166 3 หลายเดือนก่อน

    best DSA course I have gone through so far!

  • @giridharanias7567
    @giridharanias7567 2 ปีที่แล้ว +2

    thalaiva nee vera level 🤩🤩🤩

  • @AnishSoni-eq7re
    @AnishSoni-eq7re 3 หลายเดือนก่อน

    solving leetcode questions by my own without seeing solution gave me next kaevel of motivation , thank you so much kunal you are the best

  • @vishrudhraj6272
    @vishrudhraj6272 2 ปีที่แล้ว +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 2 ปีที่แล้ว

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

    • @sourin.majumdar
      @sourin.majumdar ปีที่แล้ว +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.

  • @jazibbashar3332
    @jazibbashar3332 2 ปีที่แล้ว

    I literally give up for coding i think i m not made for coding but ur video and motivation fully motivated me now i my self search for the hard level questions and solve it by my self thank you kunal.....u literally provide free course for which many websites ask for the charges and also don't give full explanation.

  • @vipulpandey682
    @vipulpandey682 2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

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

    • @kirtisinha2000
      @kirtisinha2000 ปีที่แล้ว

      It means u are working at faang. Companies??

  • @pawanyadav4024
    @pawanyadav4024 4 หลายเดือนก่อน

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

  • @ayushranjan3014
    @ayushranjan3014 2 ปีที่แล้ว +5

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

  • @Aqirlone
    @Aqirlone 2 ปีที่แล้ว

    i will say only one this to the students who are preparing for job .here are you at best place watch all videos .you get your goal.dont miss anything .i search for 1 month n finally found a gem of videos.love from kashmirrrrrrrrrrr

  • @srivardhan.s5191
    @srivardhan.s5191 9 หลายเดือนก่อน +6

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

    • @TutorialTechie
      @TutorialTechie 8 หลายเดือนก่อน

      I also had the same doubt ?

  • @surajpr2521
    @surajpr2521 3 ปีที่แล้ว +22

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

    • @prettylilnerdy6802
      @prettylilnerdy6802 2 ปีที่แล้ว +3

      wondering same

    • @eldavimost
      @eldavimost 2 ปีที่แล้ว +1

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

    • @mukul-kr
      @mukul-kr 2 ปีที่แล้ว +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 2 ปีที่แล้ว

      @@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 2 ปีที่แล้ว

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

  • @avinashpowar1804
    @avinashpowar1804 ปีที่แล้ว

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

  • @anshrohatgi8602
    @anshrohatgi8602 3 ปีที่แล้ว +5

    Never learned such things in deep

  • @rosariobeck6254
    @rosariobeck6254 3 ปีที่แล้ว +1

    Dude the way I am able to solve problems by pattern recognition is amazing. I think the way you teach how to approach a problem is something teachers don't generally teach. Or even in dsa course which I bought geeksfor geeksDSA this bootcamp provides more value to you than buying some DSA course unless you are going to buy some fancy 30-200 k .I would like to say kunal keep up the good work.
    Thanks for clearing people doubts, miss information . I think the work your doing is pure gold mine for me atlest.

    • @balibhadrasingh6730
      @balibhadrasingh6730 2 ปีที่แล้ว

      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

  • @vaishaligentyal1777
    @vaishaligentyal1777 2 ปีที่แล้ว +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 2 ปีที่แล้ว

      He's too busy for that

    • @superfax
      @superfax ปีที่แล้ว

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

  • @sarthakyadav9950
    @sarthakyadav9950 2 ปีที่แล้ว +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!!!❤❤

  • @shubhamgoswami8751
    @shubhamgoswami8751 3 ปีที่แล้ว +5

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

    • @KunalKushwaha
      @KunalKushwaha  3 ปีที่แล้ว +7

      Don't worry I always maintain quality

  • @santoshkakad7868
    @santoshkakad7868 3 หลายเดือนก่อน +1

    Thanks for giving a right approach of doing problem solving

  • @laugh_till_u_pee968
    @laugh_till_u_pee968 3 ปีที่แล้ว +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  3 ปีที่แล้ว +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 3 ปีที่แล้ว

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

    • @aarzoo_chourasia
      @aarzoo_chourasia 3 ปีที่แล้ว

      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.

  • @carrielii7239
    @carrielii7239 ปีที่แล้ว

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

  • @sarveshpatel492
    @sarveshpatel492 ปีที่แล้ว

    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.

  • @chandukamtam6249
    @chandukamtam6249 2 ปีที่แล้ว +1

    I never thought that I would solve the leetcode problems ..It is possible only because of u kunal..Thank u

  • @paramveersinghgill4076
    @paramveersinghgill4076 ปีที่แล้ว

    Q1: Missing Number
    Alternate solution-
    int missingNumber(vector& nums) {
    int ans=0;
    for(int i=0;i

  • @pranaypulipaka
    @pranaypulipaka 5 หลายเดือนก่อน

    I just wrote the program after listening to your theory explaination, Kunal.
    Started learning from Java syntax in the beginning to writing program just by looking theory.
    Kunal made the best course.

  • @vivekkhatri1759
    @vivekkhatri1759 2 ปีที่แล้ว

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

  • @sahu_SuMiT
    @sahu_SuMiT 3 หลายเดือนก่อน +1

    having a good time with Kunal ....

  • @gunasekaranp9286
    @gunasekaranp9286 4 หลายเดือนก่อน

    Please continue this good work at any situation. Your videos are like studying engineering again with so much interest and detail.

  • @clomose5740
    @clomose5740 ปีที่แล้ว +1

    Now I got confidence in cycle sort, thanks bhai

  • @informer3268
    @informer3268 ปีที่แล้ว

    I cant believe my mind all Questions one solution. how easy you are making this is crazy bro

  • @ANURAGSINGH-zg1vx
    @ANURAGSINGH-zg1vx 2 ปีที่แล้ว +2

    The cyclic sort you implemented here will only work on numbers >0 and

    • @BROOKnim
      @BROOKnim 2 ปีที่แล้ว

      thats what cyclic sort is for..we got better sort for n^2 ,,or less

  • @sai_udayagiri_casteless
    @sai_udayagiri_casteless 10 หลายเดือนก่อน

    Kunal kush"waha" wah u r just making peoples lives easy. Just fell for your understanding then fell harder for your teaching style and fell more harder for your mindset for making these lectures for free. Gem of a guy thanks for existing ❤💙💚

  • @sainagchunduru2448
    @sainagchunduru2448 ปีที่แล้ว +1

    So motivating to submit a hard problem within 1 minute at 1st attempt that beats 100%.

  • @zzdar4117
    @zzdar4117 ปีที่แล้ว

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

  • @MMirabel
    @MMirabel 8 หลายเดือนก่อน

    I shared the playlist to my friends and three of them are actually following^^
    Proud of myself!