there is a mistake in the next permutation at 2:48 next permutation of 41532 is 42135, but you've corrected it further in the video
@MrChetan54
2 жыл бұрын
Nice explaination, very crisp. Had tough time understadning the question itself. Now its much easy. Please continue the series
@AyushiSharmaDSA
2 жыл бұрын
Thank you Chetan, glad it was helpful :)
@amitpoudel1212
3 жыл бұрын
your explanation to the approach is next level loving your array playlist keep uploading
@AyushiSharmaDSA
3 жыл бұрын
Thank you so much Amit. Means a lot❤. Please share the channel with your friends and juniors :)
@ytg6663
2 жыл бұрын
LoL. Simp
@DheerajYadav-sf6tu
2 жыл бұрын
I was struggling for 3 days to understand this question. Finally I got this video ,thank you so much. you explained question in a very simple way. Keep doing This. Thanks
@AyushiSharmaDSA
2 жыл бұрын
Welcome Dheeraj, glad it was helpful :)
@user-general7du2zf7i
2 жыл бұрын
Mam your explanation makes problem and it's approach clear thanks for helping us
@AyushiSharmaDSA
2 жыл бұрын
Thank you Aman, means a lot :)
@uday_vlogsandgaming
3 ай бұрын
sister you are awesome. this is my second day for this permutation problem. maine sub dekh lia but sirf yahe samza hai abhe
@AyushiSharmaDSA
3 ай бұрын
no, you are awesome :) thank you so much uday :)
@whtthywnt4259
2 жыл бұрын
you make every question so simple!!! great job
@AyushiSharmaDSA
2 жыл бұрын
Thank you so much. Means a lot :)
@Chaloobolo
Жыл бұрын
How 41532 lexicograhically became 42153 ? It should be 42135 right ?
@UtkarshOjha
10 ай бұрын
di hindi me smjhane ke bhut bhut dhanyawad 🥰, great explaination
@AyushiSharmaDSA
9 ай бұрын
thank you Utkarsh :)
@kalpeshsaubhri
Жыл бұрын
In video you are saying to sort the remaining elements after swapping. Ideally it should be equaivalent to reverse which you have put in IDE. Reason being the remaining array which you want to sort is already sorted in reverse order. If you reverse it you will get sorted elements in ascending order. Using reverse instead of sort will make sure that time complexity is not reaching more than o(n) and space complexity is not going more than O(1) else it is not possible
@lovneetchugh8063
3 жыл бұрын
Wrong Answer.. at last we have to sort from idx1+1 to size
@KumarMuravath-YearBTechChemica
2 жыл бұрын
crystal clear explanation🔥🔥🔥
@AyushiSharmaDSA
Ай бұрын
thank you :)
@darshankalathiya8667
2 жыл бұрын
your explanation to the approach is next level and I suggestion to you more and more contain full video create and you are a amazing teaching skill ..
@AyushiSharmaDSA
2 жыл бұрын
Thank you Darshan, glad it was helpful :)
@ShivangiSingh-wc3gk
2 жыл бұрын
Looks like I enjoy watching DS VIDEOS in Hindi. Lovely explanation.
@AyushiSharmaDSA
2 жыл бұрын
Thank you Shivangi, glad it was helpful :)
@pavanmutalikdesai6611
Жыл бұрын
Great Explanation giving the intuition and how can we approach a problem.
@AyushiSharmaDSA
Ай бұрын
thank you :)
@meb1376
2 жыл бұрын
Thank you very much for your simple and clear explanation!!:)))))
@AyushiSharmaDSA
2 жыл бұрын
Welcome, glad it was helpful :)
@gedelasivakrishna
9 ай бұрын
What a explination ! , I understood it in one go..
@AyushiSharmaDSA
9 ай бұрын
glad you found it helpful :)
@vikrant9272
2 жыл бұрын
Finally Understood the whole thing!!!!!!!
@rishabhvarshney9798
2 жыл бұрын
So beautiful explanation
@AyushiSharmaDSA
2 жыл бұрын
Thanks Rishabh :)
@yourentertainer19
2 жыл бұрын
it will be more intuitive if idx is initialized with -1
@tejaharshau4032
2 жыл бұрын
may i know what is the point of finding idx2 as it is always last element
@manojgmanojg9600
Жыл бұрын
Such a very good explanation.
@AyushiSharmaDSA
Жыл бұрын
Thanks Manoj 🤗
@03_abhishekchoubey42
2 жыл бұрын
Thanks for your amazing explanation it really helps me a lot😍
@AyushiSharmaDSA
2 жыл бұрын
Welcome Abhishek! glad it was helpful😊
@tusharnain6652
2 жыл бұрын
You never dissapoint!
@AyushiSharmaDSA
2 жыл бұрын
Thanks Tushar, means a lot :)
@harshbardhanon4901
2 жыл бұрын
Thanks mam for wonderful explanation.
@AyushiSharmaDSA
2 жыл бұрын
Welcome Harsh 😄
@AmanSharma-vb5jl
3 жыл бұрын
Fun learning this solution
@AyushiSharmaDSA
3 жыл бұрын
😁✌🏻
@anubhabray5254
2 жыл бұрын
Awesome explanation! Loved it!
@AyushiSharmaDSA
2 жыл бұрын
Thank you :)
@SWE_69
Жыл бұрын
i think we need to add this also idx2 = Math.min(i,idx2); in second loop please correct me if iam wrong
@bikkysharma7253
2 жыл бұрын
bahut ache se samjh me aaya,thanks
@AyushiSharmaDSA
2 жыл бұрын
Welcome Bikky, glad it was helpful 🙂
@shreyvardhandhiman
3 жыл бұрын
Thankyou so much!
@manojgmanojg9600
Жыл бұрын
Your Videos little long as compare to others but You explained the each and every concept very well as compared to others,thank you.
@AyushiSharmaDSA
Жыл бұрын
Thank you so much Manoj , means a lot 😊💫
@Manish-ww3lg
2 жыл бұрын
when no value comes in idx1 so how can be it is less than 0??
@sidharthgaikwad6258
Жыл бұрын
Thank you diii best explaination!!
@AyushiSharmaDSA
5 ай бұрын
thank you, glad it was helpful :)
@ananyasharma5364
3 жыл бұрын
🙌🏻
@mutasimrafid4446
2 жыл бұрын
Best explanation on you tube ❤❤
@AyushiSharmaDSA
2 жыл бұрын
Thank you so much 😊🙌🏻
@aakashprajapati4836
Жыл бұрын
Great Explaination🔥🔥
@AyushiSharmaDSA
Жыл бұрын
Thanks Aakash 🤗
@Saurabh-gg9lv
2 жыл бұрын
explanation👌💫
@AyushiSharmaDSA
2 жыл бұрын
Thank you, glad it was helpful :)
@madhusudhakar111
3 ай бұрын
Thank you
@AyushiSharmaDSA
3 ай бұрын
You're welcome
@niteenautade
2 жыл бұрын
Very well explained
@AyushiSharmaDSA
2 жыл бұрын
Thank you Niteen :)
@mayuranklekar
2 жыл бұрын
😃
@5minupsc723
9 сағат бұрын
can u share the above excel sheet
@nikhilsachan9898
2 жыл бұрын
Waiting for graph series🙂
@shiwanshujoshi1319
2 жыл бұрын
thank you samajh aa gya
@AyushiSharmaDSA
2 жыл бұрын
Welcome 🤗
@shaantyagi2187
Жыл бұрын
Thanks
@AyushiSharmaDSA
Жыл бұрын
Welcome 🤗
@sohebshaikh3344
2 жыл бұрын
great Explanation
@AyushiSharmaDSA
2 жыл бұрын
Thank you Soheb :)
@sumitsakpal7085
2 жыл бұрын
very good explanation😀
@AyushiSharmaDSA
2 жыл бұрын
Thanks Sumit 🤗
@muskanaggarwal9659
3 жыл бұрын
your code's logic is wrong somewhere i think so because it is getting compiled but giving wrong output .
@muskanaggarwal9659
3 жыл бұрын
class Solution { public void nextPermutation(int[] nums) { int ind1=0; int ind2=0; if(nums.length==1){ return ; } for(int i=nums.length-2;i>=0;i--){ if(nums[i]nums[ind1]){ ind2=j; break; } } } } int temp=nums[ind1]; nums[ind1]=nums[ind2]; nums[ind2]=temp; Arrays.sort(nums,ind1+1,nums.length); } }
@yourentertainer19
2 жыл бұрын
initialize idx=-1
@sohel4633
2 жыл бұрын
helpful explanation.. Thanks di
@AyushiSharmaDSA
2 жыл бұрын
Welcome Sohel, glad it was helpful :)
@NitinSingh-wp5lj
2 жыл бұрын
Best explanation 💥
@AyushiSharmaDSA
2 жыл бұрын
Thank you Nitin, glad it was helpful :)
@VivekYadav-vl5lt
2 жыл бұрын
great explanation
@AyushiSharmaDSA
2 жыл бұрын
Thank you Vivek😊
@mohammadgouse4992
2 жыл бұрын
Nice explanation 👌
@AyushiSharmaDSA
2 жыл бұрын
Thank you😊
@vanshaj4058
Жыл бұрын
good explanation didi ❣
@rohitkumarsinha876
2 жыл бұрын
very helpful ayushi
@AyushiSharmaDSA
2 жыл бұрын
Thank you so much Rohit :) glad it was helpful
@deepakchawla1105
2 жыл бұрын
great explnantion
@AyushiSharmaDSA
2 жыл бұрын
Thank you. Glad you found it helpful :)
@nikitajaiswal9112
2 жыл бұрын
Wow amazing😍👍 keep it up
@AyushiSharmaDSA
2 жыл бұрын
Thank you Nikita, glad it was helpful :)
@nirmalgeetmala
3 жыл бұрын
Nice upload
@mahadevproduction5495
3 жыл бұрын
Very good
@umang1226
2 жыл бұрын
Can you provide the brute Force method .
@ant9177
Жыл бұрын
231 iska next parmutation is algorithm se kaise aa rha hain ?
@RAUSHANKUMAR-iq4yj
2 жыл бұрын
Thanks❤🌹🙏
@AyushiSharmaDSA
2 жыл бұрын
Welcome Raushan :)
@kishansakariya9200
Жыл бұрын
why we take starting index n-2 instead of n-1?
@ritiktanwar9709
8 ай бұрын
when you take n-1 instead of n-2 then you will compare the nums[i] > nums[i-1] which gives overflow condition when the value of i reached to zero. That's why we are using n-2 instead of n-1 hope you got my point
@stutijha4476
2 жыл бұрын
Nice explanation bro ❤️ .
@AyushiSharmaDSA
2 жыл бұрын
Thanks bro ❤️
@aanchalkathuria4201
2 жыл бұрын
well explained!!
@AyushiSharmaDSA
2 жыл бұрын
Thank you 😊
@surjeetsingh-cp6hn
2 жыл бұрын
mam can you plzz make a playlist of love babbar dsa sheet . i am unable to find playlist regarding this. do needful help. thankyou.
@AyushiSharmaDSA
2 жыл бұрын
Hi Surjeet, I have already covered arrays, linked list from the sheet, will soon upload other topics problems as well :)
@adityarangra9019
Жыл бұрын
run time is high
@SavitarOP
2 жыл бұрын
OP solution
@AyushiSharmaDSA
2 жыл бұрын
Thank you :)
@buntygodara4773
2 жыл бұрын
👌👍✌
@AyushiSharmaDSA
2 жыл бұрын
Thank you :)
@aryangrover7216
2 жыл бұрын
You told about sort, but aapne last mei reverse kyu krdiya, will that be true, ki hmesha reverse se ans smallest hi ayega?
@raghuvicky6632
2 жыл бұрын
TIME Complexity kya hogi iski??
@narottamsarkar2638
3 жыл бұрын
Python solution is not executed please to help make a separate video for this as soon as possible because I have TCS ninja exam so please
@AyushiSharmaDSA
3 жыл бұрын
Hi Narottam, can you tell exactly on what I should make video on?
@आर्यन-ज1ढ
Жыл бұрын
next_permutation(nums.begin(), nums.end());}
@gungunsinghal9562
3 жыл бұрын
Keep it up di 😊
@AyushiSharmaDSA
3 жыл бұрын
Thank you :)
@RakeshSingh-ou4po
Жыл бұрын
theek h
@the_ghost_of_uchiha5939
2 жыл бұрын
Hi Ayushi ! Can you please explain the last part 14:00 . Through the whole video you told that, after swapping you are gonna sort from idx1 to rest ,this will work for sure ,but why did you reverse it ? I mean how reverse worked in this case?? Can you please explain!
@shivnathyadav7336
2 жыл бұрын
Madara Uchiha bro-> the case in which we unable to find index1.. I mean when we unable to smaller number than it's next element.. then it means all the numbers are sorted in decreasing order... then you can sort in increasing order just by reverse in O(n)
@sanjanasain1999
2 жыл бұрын
You can use sort function as well, It is working properly. sort(nums.begin()+idx1+1, nums.end());
@the_ghost_of_uchiha5939
2 жыл бұрын
@@shivnathyadav7336 Thanks😇
@the_ghost_of_uchiha5939
2 жыл бұрын
@@sanjanasain1999 Thanks😇
@mohammadgouse4992
2 жыл бұрын
subscribed after watching only 1 minute 😄
@AyushiSharmaDSA
2 жыл бұрын
Thank you😊😊
@abhishekrawat664
2 жыл бұрын
Nice yrr💜
@AyushiSharmaDSA
2 жыл бұрын
Thanks Abhishek :)
@keshavgaur4535
3 жыл бұрын
how can be the the value of indx1 is less than 0??🤔. Please reply
@srjop5566
2 жыл бұрын
index jab 0 se less hoga matlab idx1 me value nhi hogi and uska idx 0 se less hogaya hoga
@rishalirishu5833
2 жыл бұрын
you're pro mam
@AyushiSharmaDSA
2 жыл бұрын
Thank you Rishali, glad it was helpful :)
@ajit287
3 жыл бұрын
Hi Ayushi can u help to solve this problem "Prime summation" from tcs codevita.
@AyushiSharmaDSA
3 жыл бұрын
Can you please send the problem statement
@ajit287
3 жыл бұрын
Some prime numbers can be expressed as a sum of other consecutive prime numbers. For example 5 = 2 + 3, 17 = 2 + 3 + 5 + 7, 41 = 2 + 3 + 5 + 7 + 11 + 13. Your task is to find out how many prime numbers which satisfy this property are present in the range 3 to N subject to a constraint that summation should always start with number 2. Write code to find out the number of prime numbers that satisfy the above-mentioned property in a given range.
@saunaknandi1814
2 жыл бұрын
@@AyushiSharmaDSA can u send the solution below for the question asked by Uday
@saunaknandi1814
2 жыл бұрын
@@ajit287 have u got the answer
@ajit287
2 жыл бұрын
@@saunaknandi1814 no
@saunaknandi1814
2 жыл бұрын
Smjh gaya me WoW, kya ham LinkedIn me connect ho sktey hai
@AyushiSharmaDSA
2 жыл бұрын
Sure
@dhruvratra992
3 жыл бұрын
Can you tell me how to crack Walmart Global Tech interview and how should I prepare for that. Plz di I am your big fan didi 👍
@AyushiSharmaDSA
3 жыл бұрын
Be good in data structure and algorithm and problem solving Make 2-3 good projects Cs subjects like os, cn and dbms I hope this helps :)
@dhruvratra992
3 жыл бұрын
@@AyushiSharmaDSA where should I prepare for that didi
@AyushiSharmaDSA
3 жыл бұрын
@@dhruvratra992 first learn basic implementation of different data structures from gfg or from youTube or you can learn from course. Once done, then practice from leetcode, interview bit or codeforces.
@dhruvratra992
3 жыл бұрын
@@AyushiSharmaDSA thank you didi you are the best
@saunaknandi1814
2 жыл бұрын
@@dhruvratra992 bro why only that company?
@zackshortsyt3202
2 жыл бұрын
4 1 5 3 2 ka 4 2 135 hoga
@gungunsinghal9562
3 жыл бұрын
Di which pen you use for writing on whiteboard?
@AyushiSharmaDSA
3 жыл бұрын
I use mouse only :)
@gungunsinghal9562
3 жыл бұрын
@@AyushiSharmaDSA Okay di.. that's great 😊
@grifith2196
3 жыл бұрын
Nice efforts, try a pen tablet, you can be more precise that way, and if you're writing by mouse, that's great writing
@AyushiSharmaDSA
3 жыл бұрын
@@grifith2196 yes I will try with pen tablet. Thank you :)
@AzureAditya
3 жыл бұрын
I love you sincew I see 🙈 you first time. Plz accept my Proposall. Plzz reply me
@bhuvandahal421
Жыл бұрын
My code: class Solution { public: void nextPermutation(vector& nums) { if(nums.size() == 1) return; int n = nums.size(); for(int i = n - 1; i > 0; --i) { if(nums[i] > nums[i - 1]) { for(int j = n - 1; j >= i ; --j) { if(nums[j] > nums[i - 1]) { int temp = nums[j]; nums[j] = nums[i - 1]; nums[i - 1] = temp; sort(nums.begin() + i, nums.end()); return; } } } } sort(nums.begin(), nums.end()); } };
@आर्यन-ज1ढ
Жыл бұрын
next_permutation(nums.begin(), nums.end());} THIS WILL DO THE WORK FOR YOU DON'T WASTE YOUR TIME
@sinister_rules
2 жыл бұрын
amazing explanation
@AyushiSharmaDSA
2 жыл бұрын
Thank you Yash :)
@AzureAditya
3 жыл бұрын
I love you sincew I see 🙈 you first time. Plz accept my Proposall. Plzz reply me
Пікірлер: 165