Merge Sorted Array | Leetcode 88

Поділитися
Вставка
  • Опубліковано 5 січ 2025

КОМЕНТАРІ • 66

  • @pragmaticcoder6910
    @pragmaticcoder6910 10 місяців тому +20

    Your explanations are much better than LeetCode Editorial solutions. Thanks !

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

      bro im new to this and i didnt understand anything , how to begin learning

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

      @@somaynaik06 what you did't understand here ?

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

    Thank you very much! I finally understood how to solve this problem without creating new array

  • @YashSingh-xs5yj
    @YashSingh-xs5yj 3 місяці тому

    Thanks for explaining this question so well, I have just started with LC and your videos are helpful

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

    To the point and simple! awesome explanation.

  • @thAsciNileshPal
    @thAsciNileshPal 5 місяців тому +4

    keep it up didiiiii ; U and SashCode channel doing great job ; i request u too pls come up with the series of daily leetcode potd solutionss

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

    Mam, only 6 problems there in Top 150 interview category. Please complete this section

  • @coprothin7896
    @coprothin7896 26 днів тому

    Why you started arranging elements from last is it because of zeros.?

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

    Can you explain the Time and space complexity in this program?

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

    found this channel today keep making videos like this best of luck friend

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

    Outstanding explanation in such a ez way

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

    great explanation mam..thank you so much

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

    how we are taking i=m-1; i dont understand that particular part

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

      in above example, m is equal to 3, means 3rd position. But the index in Array starts from 0 and position starts from 1. So (i =m-1) means that In above example, when the position is 3 then the index will be 2. That is the reason that we subtract 1 from the position of Array to get the index. Hope u understand...

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

      @@mohsinbehzad8993 good explanation.

  • @SatvikGyan-g1t
    @SatvikGyan-g1t Рік тому

    Thanks mam apke solution se maine DSA ke bhut ache ache concepts sikha paya

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

    Ma'am please solve other interview questions...your explanations are very good.Thankyou🤗

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

      Hi..Will continue leetcode questions series very soon..Please stay tuned..
      Thanks!

  • @AshishKumar-od3pr
    @AshishKumar-od3pr 9 місяців тому

    Why are we using 0,0,0 in the end of nums1, since arrays are mutable?

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

      arrays are fixed in nature if you don't initialised it with 0s what you will put there other than zero to make it size of m i.e 6 here
      2nd thing if you use scanner class also arrays will get initialised with zeros only for int values.

    • @AshishKumar-od3pr
      @AshishKumar-od3pr 9 місяців тому

      @@syedrizwan2203 thanks bro

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

    Very Nice Video! Thanks Ma'am

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

    ye numbers swap nai kerne honge?

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

    can you share your git repo.

  • @sparkyy10
    @sparkyy10 День тому

    plz start again this series

  • @pcuseruser-n3f
    @pcuseruser-n3f Рік тому +2

    mam ek doubt h
    ki apne loop start karte time j>=0 ki place pr i>=0 kyu nhi likha ???

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

      kyunki humko second array se hi compare karna hai na.... aur resultant changes i variable ko represent karte hai .
      aur humne final result bhi wahin store karna hai.

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

    Thank you so much 🙏

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

    Your videos are great. Thank you

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

    dear sister, I am unable to catch the coding logic without seeing the code in video or other tutorial but i understand what to do but cant implement the code .this giving me much stress, I am a beginner .I have solved 9 easy problem but in every problem i have to take help..what should i do?where should i focus on.can I be a good programmer?

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

      just keep grinding.

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

      Keep practicing easy lvl problems and build that confidence!

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

      @@humanityrush thanks for your advice.

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

    Why not just put the nums2 inside nums1 and sort the array ? wouldn't that be much easier ?

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

      Cause both are already sorted and it will increase the time complexity of the solution, first you will put each element in the array then start using any of the sorting algorithm

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

    Plz mam can u teach how to implement hashmap and other collection things in problems detail video so many students gets confusing in that

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

    Thank you ma'am

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

    Hi mam
    your explanation is very easy so please can you make leet code video in java please mam

  • @ДмитрийКоломеец-э2т

    god level explanation

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

    Mam please upload the video on Leetcode problem no- 238. Product of Array Except Self

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

    thank you, mam.

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

    Thankyou ❤

  • @s.pavithra5238
    @s.pavithra5238 3 місяці тому +1

    pls upload more videos

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

    nice

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

    Thank you!

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

    Awesome thanks

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

    great expplanation.

  • @Rob-J-BJJ
    @Rob-J-BJJ Рік тому

    thank you it worked fine

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

    7:05

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

    Didi you don't explain why we have to place i, j or k pointers at that position only 😢 . Why can't we start our pointers from somewhere else . You should explain also as it will help with thought process

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

      Because we are starting from some specific point that is num1 and nums2 places because these arrays are sorted already. We can't randomly put pointers

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

      because since we put i or j into the k we should move forward which means - -

  • @movieshots2135
    @movieshots2135 8 місяців тому +1

    there is solution better than this just add nums2[] elements in the nums1[] array and sort them

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

    Cute kitni hai ye ❤

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

    it is best and simple than above
    class Solution {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
    for (int j = 0, i = m; j < n; j++) {
    nums1[i] = nums2[j];
    i++;
    }
    Arrays.sort(nums1);
    }
    }

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

    Hi, pls continue this series. #addicted

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

    This code is fail when m=0

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

      Hi..
      The code will not fail..As mentioned in the problem, m=0 means there are no elements in the nums 1 arrays so the output would be all elements of nums2 array..
      Please try the code..I have tried and submItted ,it's working fine

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

      Yes its failing check again didi

    • @Rob-J-BJJ
      @Rob-J-BJJ Рік тому

      it works for me

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

      Yes it is not working

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

    class Solution {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
    int count=0;
    for(int i=m;i