Bhaiya aap jaise 1-2 utubers aur aa jaye..fir coding blocks aur ninjas to katora lekrr ghumenge.... U r a big support for the students like me who cannot afford those extremely expensive courses. Request h ki aap continue krtee rhoo... Plzz.... 🤣
@thexhist36093 жыл бұрын
We also have pepcoding which is good and everything is free.
@tanned_cosines_2 жыл бұрын
lmfaoooooo
@mishorpatra16703 жыл бұрын
"Once you learn to approach problems, you'll stop running after the solution." - Sir Aditya Verma (bas ab ek backracking aur graph playlist banado aur kuch nahi chahiye)
@amarnathprasad13 жыл бұрын
Until he makes one, you can watch the first six lectures from here and solve questions from the FreeCodeCamp video(7th video in the playlist). I got better at graphs after practicing questions from the FCC video. kzbin.info/aero/PLmqutD5ta9PvsMYCyc0tVpmIl8-iIgxey
@nitwaalebhaiya3 жыл бұрын
@@amarnathprasad1 Thanks
@Adarsh-mn7pl2 жыл бұрын
bul ja, ab kuch nhi ane wala
@nidhishprasad25062 жыл бұрын
@@Adarsh-mn7pl why?
@mantenapragnyabala17114 ай бұрын
Hi do you know from where to do queue@@amarnathprasad1
@govindsharma69517 ай бұрын
can not explain how much happy i am after finding your channel. thank u so much for creating these videos
@hereyoursdad2 жыл бұрын
sir more then that the little talk from your exeperience like what they want from us is really a diamond .. thank you so much for making these gems will help so many peoples
@upasanaarora26414 жыл бұрын
for almost 1 month searching for new fresh content to revise my concepts again,loved your channel.Its has all,what it needs to be done even in short time,To the point and great content.Great Job :)
@Area-fd8ht Жыл бұрын
❤
@karanbhati75523 жыл бұрын
More Concise code :: vector nextLargerElement(vector a, int n){ stack s; vector ans; for(int i=n-1;i>=0;i--){ while(!s.empty() && a[i]>=s.top()){ s.pop(); } if(s.empty()) ans.push_back(-1); else ans.push_back(s.top()); s.push(a[i]); } reverse(ans.begin(),ans.end()); return ans; }
@pragyanshandilya40152 жыл бұрын
legend
@charugoswami5344 Жыл бұрын
Kindly help me to find error in this code.... vector nextGreaterElements(vector& nums) { stacks; vectorv; for(int i=nums.size()-1;i>=0;i--){ while(!s.empty() && s.top()
@_AmbujJaiswal Жыл бұрын
bhati bhai thankyou soo much
@samikshayadav3475 Жыл бұрын
good good
@manjeshpatil Жыл бұрын
So basically at n-1 checking your code executes the while loop first even though the stack is empty that's y write the if condition 1st then else then the while loop. Correct me if iam wrong @@charugoswami5344
@comps_52_mankritsingh843 жыл бұрын
*Interesting thing to note* For those who are getting segmentation error even though your code is the same check whether you have done the seek or top operation on the stack in your code? for eg in the code while(s.top()0) In this code when the stack is empty the first condition will be checked first and give you segmentation error.Instead, keep the statement after the empty check and the error will go. Hope it helps ;)
@abhijeeyt2 жыл бұрын
bhai 🙏🙏
@Lucifer-jl9vh2 жыл бұрын
Thank you bhai
@pranjalmukherjee Жыл бұрын
Thank you bhai
@tanya2586 Жыл бұрын
heyy.. i'm still getting error.. can you check why? vector v; stack s; for(int i=n-1;i>=0;i--){ if(s.empty()){ v.push_back(-1); } else if(s.top()>arr[i]){ v.push_back(s.top()); } else if(arr[i]>=s.top()){ while( s.size()>0 && arr[i]
@comps_52_mankritsingh84 Жыл бұрын
@@tanya2586 try by removing that ! Sign in the last check you have put if(!s.empty()) .
@abhijeetgupta34614 жыл бұрын
reverse(v.begin(),v.end()) after for loop ...
@ShahNawaz-cx3pi3 жыл бұрын
*********Time complexity Doubt:-******** I got what you want to ask:- your main concern is about the inside while() loop, you are thinking that it will become O(n^2) , but this will never happen the worst case complexity can be O(2n) , in simple terms O(n) . Case 1 :- arr [] :- 6 5 4 3 2 1 In this case the while() loop will run only one time in each iteration of for() loop so, while() loop is contributing only O(1) complexity. In this case it is simple O(n). Case 2:- are[]:- 6 1 2 3 4 5 In this case every element in the array will considered 2 times. First time when we are traversing the array in backward direction through for() loop and another time when we traverse element in forward direction through while() loop. It is just like traversing array two times O(n) +O(n) =O(2*n). So, The overall complexity become O(2n) ~ O(n).
@tiyashadas52473 жыл бұрын
Thank you!
@sanyam97122 жыл бұрын
Thankyou
@kingrajput62022 жыл бұрын
thanks man
@PankajSingh-vi3fy2 жыл бұрын
For me it's kinda tricky but got your point thanks
@rajatagarwal60912 жыл бұрын
Hi @Shah Nawaz. Thanks for your explanation. However I still have a doubt that worst case complexity would be O(n^2). let consider some array like 20,14,15,16,17,18,19, 10,7,8,9 , 6,1,2,3,4,5. What are your thoughts on this array?
@williamgilfoyle32612 жыл бұрын
Best explanation so far, but i would prefer "while loop" over "for loop" , for current problem and in the third if case we dont move to the next element in the array until we pop all the elements from array Like here Python : Language arr = [1,3,0,0,1,2,4] stack = [ ] res = [ ] i = len( arr ) - 1 while i>=0: if not stack: res.append(-1) elif stack[ -1 ]>arr[ i ]: res.append(stack[-1]) elif stack[ -1 ]
@sushmitamandal1677 Жыл бұрын
my programme is not running can you please help to run the code?please
@pratikkedar44762 жыл бұрын
Small Optimization : We can avoid using reverse method, just need to push elements from array in reverse order ! Make sure you define fixed vector length else will give compilation errors!!
@pokeindia5361 Жыл бұрын
Why is this so we don't need size of vectors ryt?? I'm facing this problem
@Demodulator7 Жыл бұрын
@@pokeindia5361 we need size of answer vector and it will be equal to given vector
@pokeindia5361 Жыл бұрын
@@Demodulator7 I'm asking why we need to fixed vector length vector is automatically adjusted on its own ryt??
@Demodulator7 Жыл бұрын
@@pokeindia5361 but in optimization, you are filling vector from backward (so that you not need to reverse it) so you have to give the length that from where you are filling. And you can't use push_back because it adds value in last, but each time you want to add values at front because first you calculated value for I = n-1 (last element) and then for i= n-2 (second last element) and so on till the first element. So you have to do V[i]= .... So you have to give vector a size because vector can increase it's size in one direction only. If you directly do V[n-1] =.... Then it will give runtime error because vector is trying to access n-1 position but currently vector size is 0. One more point:- doing push_back doesn't require size declaration. But when ever you do V[I] = .... Then size of vector should be greater then I. If not want to declare size then you can use 'list' and do push_front Hope it helps...
@pokeindia5361 Жыл бұрын
@@Demodulator7 thank u so much sir!!
@adarshanand1764 жыл бұрын
this is ur first impression on me... and its really looks like my dream teaching style. 🤩✌
@abhishekojha45402 жыл бұрын
brother I was stuck in this question for so long time and no one has explained this question to me in so much detail. Thanks a lot.
@adityachauhan99518 ай бұрын
best explanation available on KZbin thank you so much
@SauravKumar-si7kt3 жыл бұрын
This is sth which i need in other youtube solutions. I never got satisfied with their solution because they are just discussing the solution. And those solution never helped me. Thank you for introducing these all concept. It would have taken a lot of time to think on our own.
@akashdawari46654 жыл бұрын
continue bro, this good work ;)
@TheAdityaVerma4 жыл бұрын
Thanks brother, Do subscribe and share, that keeps me motivated to do more !!
@samirsaurabh57853 жыл бұрын
@@TheAdityaVerma please make such great videos on all data structures and algortihms,you are the true mentor ❤️.
@nandasaikishore4783 жыл бұрын
@@TheAdityaVerma please continue the course sir please 🙏🙏🙏
@souravsaha34463 жыл бұрын
@@TheAdityaVerma Brother please upload videos on some other topics please You are not only a teacher to me but also a coding guru who can teach with his experience please sir upload on backtracking and graphs
@vathsan39063 жыл бұрын
Bhai.. Sorry I would like to call you SIR.. Hats off.. I was scratching my head for the past 2 days trying to figure out why they are using stack, how to identify what to use and when to use and also to get the approach to solve... I was unable to understand it from GFG and thank god I found you!! Finally understood why we are using stack and what is it's purpose in this question...
@RohithRock4 жыл бұрын
Crystal clear explanation bro. Really it helped me a lot in understanding the concepts perfectly. I was really afraid of datastructures and algorithms. I was not able to solve the questions thinking that ds is a really tuff subject. But now through ur way of teaching and explaining i am able to learn and understand easily. Thank you bro. Do more videos regarding the ds topics. From - rohith Nit bhopal cse
@hackzyoboy24594 жыл бұрын
165th like, 0 dislikes. That's the power of generous teaching. Great job bhaii
@amankumar-im8kk4 жыл бұрын
Awesome content. You will be hitting 1M subscribers soon. Far better than paid contents of coding blocks and coding ninjas.
@theunusual45662 жыл бұрын
Matlab, Kamaal Ka explanation bhai. Automatically understood next 3 questions. Bahut Khood Samjhaya Aapne. Thanks.
@animeshsingh28803 жыл бұрын
Best videos in youtube for learning DSA
@utsavseth6573 Жыл бұрын
Not all heroes wear capes. Some are named aditya verma. Superb.
@jhanvisaraswat69763 жыл бұрын
Those three conditions putting things in perspective so much
@akarshjaiswal16224 жыл бұрын
Great explanation... Please start uploading videos again... Looking forward for mathematics, backtracking,graph videos !
@malkeetsapien48522 жыл бұрын
Brilliantly taught Sensei !
@NotNotNithin3 жыл бұрын
Java implementation: private static List nearestGreatestToRight(int[] arr) { Stack st = new Stack(); List reverseList = new ArrayList(); List resList = new ArrayList(); int size = arr.length; for (int i = size - 1; i >= 0; i--) { if (st.empty()) { reverseList.add(-1); } else if (st.size() > 0 && st.peek() > arr[i]) { reverseList.add(st.peek()); } else if (st.size() > 0 && st.peek()
@ayush75182 жыл бұрын
thanks a lot bhai
@salonipaliwal8946 Жыл бұрын
thank you
@RohitKumar-uc4fw Жыл бұрын
Use this code to directly store from right to left. public static int[] findNextGreater(int[] ar) { int[] result = new int[ar.length]; Stack stack = new Stack(); for(int i = 0; i < ar.length; i++) { while(!stack.isEmpty() && ar[i] > ar[stack.peek()]) { int index = stack.pop(); result[index] = ar[i]; } stack.push(i); } while(!stack.isEmpty()) { int index = stack.pop(); result[index] = -1; } return result; }
@shivagupta13810 ай бұрын
@@RohitKumar-uc4fw use this and you wont need to reverse it even " public static int[] nearestright(int []arr) { Stack stack=new Stack(); int result[]=new int[arr.length]; for(int i=arr.length-1; i>=0; i--) { if(stack.size()==0) { result[i]=-1; } if(stack.size()>0 && stack.peek()>arr[i]) { result[i]=stack.peek(); } if(stack.size()>0 && stack.peek()0 && stack.peek()
@abhishekanantharam6453 жыл бұрын
O bhai legend aadmi hai ye toh. Thanks✌️
@vinayakrastogi8904 жыл бұрын
Bro I am waiting for your backtracking playlist... I know you have a busy schedule but please make videos on that
@shubhamjain545192 жыл бұрын
14:18 for context. 15:19 2 can be safely popped because we have already found an element on its left which is greater than 2, ie 3. As any element (greater than 2 and smaller than 3) on left of 3 which needs next greater element on its right will always print 3, so 2 is of no use at this point.
@alexamish20204 жыл бұрын
Ye channel bhot zyada grow krege. Gauranteed.
@nirbhay4114 жыл бұрын
Bhai kya hi samjhaya he apne . maja agaya
@aheribanerji70563 жыл бұрын
Pls, sir make more videos... it's very helpful for students like us who can't afford the high prized course .
@harjos784 жыл бұрын
loved watching your videos.. Awesome .. crystal clear explaination. Was refreshing my DS concepts to teach my son who is in 7th grade. Now after he has watched your videos he says your explaination is way better than i can explain him.. Kudos Aditya. Keep up the good work. God bless you
@ankitsharda11312 жыл бұрын
With due respect to you I would suggest you to let your son enjoy his childhood. All this he can learn it when it will be the right time.
@vanshshah7781 Жыл бұрын
7th grade is too late man
@rushikesh_chaudhari4 жыл бұрын
Just started watching your playlist and this is really mind blowing. Loved your way to find solution for problems
@AyushGupta-ux4gq11 ай бұрын
what are you doing now after 3 years of this comment ??
@bestsaurabh4 жыл бұрын
Instead of taking vector we can take array start filling it from end, this way we can save reverse function call.
@aayush54744 жыл бұрын
you can also do like vector v(n);
@niveditaprity4 жыл бұрын
Impeccable and great explanation. Please upload more videos on tree and graph also.
@lavanyabalija6994 жыл бұрын
Before listening to your lectures , am unable to write the code at 1 stretch, it used to take lot of time to debug my code. Am glad i found ur channel broo...Now am able to write code with ease. Thanxxxx for ur methodology of making coding soo easyy...Plss make more n more videos. If possible make videos on all topics of CP.
@RajveerSingh-yf1os9 ай бұрын
THIS IS MY FIRST YT COMMMENT IN MY LIFE JUST LOVES THIS VIDEO
@mystryb3454 жыл бұрын
Completed heap,dp,recursion now i m.feeling confident thanks bro ...
@mohdhasnain38123 жыл бұрын
you have studied from his channel or some where else please confirm that all the stutff you have studied in this channel is on point , effective nd easy to unxderstand
@thinkingmad16853 жыл бұрын
@@mohdhasnain3812 have you found some other channel, pls suggest btw i m feeling comfortable to understand from this channel only 🥲
@piyushaggarwal784 жыл бұрын
Initial if and elseif condition are not required as it is redundant., Very good explanation of things, great content. Waiting eagerly for Trees and Graphs and Number theory.. I always prefer watching your videos on 2x speed , it sounds perfect that way
@SurajKumar-bw9oi4 жыл бұрын
Right bro, Code written After while loop started is sufficient 👍
@pranjalsrivastava11914 жыл бұрын
true, no use for the first two conditions. Already covered by the portion after while!
@Codermonk19973 жыл бұрын
guys like u should be kicked on their arse, dumbo if u are so intelligent then go and try to get jon in mnc instead of watching his vidio. he is teaching how to convert ur idea into code, one if elsse will not going to increase time complexity to exponential. idiots like you exist every where.
@arunavgoel56203 жыл бұрын
@@Codermonk1997 Damm, the guy just pointed out another way to write the code, a way which reduces the number of lines and also makes the code run more efficiently...no need to get triggered by that
@___vandanagupta___3 жыл бұрын
Your every video is a blessing!
@r4ncreation686 Жыл бұрын
best explaination of stack till date
@AnkitKumar-rh8il3 жыл бұрын
maza aa gya bhaiya , aapka explain karne ka tareeka OP hai
@priyaagrawal29682 жыл бұрын
One of the very best explanation! Thanks Aditya !
@akashverma57569 ай бұрын
Best Explanation of this problem online
@rishabsharma53073 жыл бұрын
Little more simpler version of code // nearest greater to right vector ngr(vector arr, int n) { stack st; vector vect; for(int i = n-1; i >= 0; i--) { while(!st.empty() && arr[i] >= st.top()) st.pop(); st.empty() ? vect.push_back(-1) : vect.push_back(st.top()); st.push(arr[i]); } reverse(vect.begin(), vect.end()); return vect; }
@rishabsharma53075 ай бұрын
Slightly better approach with no vector reversal ``` vector ngl(vector &nums) { stack st; int n = nums.size(); vector result(n, -1); for (int i = n - 1; i >= 0; i--) { while (!st.empty() && nums[i] >= st.top()) st.pop(); if (!st.empty()) result[i] = st.top(); st.push(nums[i]); } return result; } ```
@souravrajvi81932 жыл бұрын
THIS IS FUNCKIN LEGENDARY
@mohitsingh6717 Жыл бұрын
best channel on youtube 🙂
@rohitjha9714 жыл бұрын
Please tree and graph bhi padhao
@TheAdityaVerma4 жыл бұрын
Will try !!
@nikhilnagrale4 жыл бұрын
@@TheAdityaVerma backtracking!!!!!!!!!1
@shrutirani68284 жыл бұрын
Please make more videos for placement prep... Ur videos are helping a lot.. Great mannn...
@ROHIT-gv7xk3 жыл бұрын
great work bro god bless you
@_solopreneur3213 жыл бұрын
bhaiya u rocked its great to be learning from ur videos keep adding value. Very helpful videos.
@rahulagarwal80594 жыл бұрын
Wow.... Really happy that i found ur channel... The videos are very helpful👍
@shashijaiswal50142 жыл бұрын
I will complete this playlist by tomorrow. 4 hr approx for this and 2hr per day. Will comment tommorow on last video of this playlist.
@anveshkhambadkar6821 Жыл бұрын
Awesome content, Awesome Explanation Man.
@RicheshGuptaRichu3 жыл бұрын
Mann karta hai pdhne ka..Aesi videos dekh kar
@SreyesSrinivasan3 жыл бұрын
Python Solution for this problem! a = [3, 0, 0, 1, 2, 4, 8] stack = list() result = [] for i in range(len(a) - 1, -1, -1): # If the stack is empty if len(stack) == 0: result.append(-1) # If the stack is not empty else: top = stack[0] # If the top element of stack is greater than a[i] if top > a[i]: result.append(top) else: # If the top element of stack is lesser than or equal to a[i] while len(stack) != 0 and stack[0]
@ritwik_shivam2 жыл бұрын
Amazing bro, thanks for this code, I was looking one for python,
@sauravsingh45884 жыл бұрын
Jitne explaination deker aap pda rahe ho bhaiya utni to coding block wale wee nahi dete.
@wrushu3 жыл бұрын
If we have the same question for cyclic array like.. instead of having -1 for arr[n-1] we need to look at the 0th element. What would you suggest? What I came across is to traverse the loop 2 times. for(i=2*n;i>=0;i--) and reference ith element as i%n
@satyamshukla14183 жыл бұрын
this is a gem of a content.thanks a lot for this bhaiya apne hisaab se time nikal krke agar aap backtracking graph par agar videos bana denge toh humari aur help ho jayegi.
@abhishekrai4002 Жыл бұрын
bhai gajab maja aagya
@Sithkar0310 ай бұрын
Coding Ninja : Next Greater Element ( C++ Solution ) #include vector nextGreaterElement(vector& arr, int n) { // Write your code here vector ans; stack st; for(int i=n-1;i>=0;i--){ while(!st.empty() && st.top()
@keshavdutttripathi3 жыл бұрын
Great work bhai. Really helpful
@VENDETTA_99 ай бұрын
For circular array: #include using namespace std; vector nextGreaterElement(int N, vector& arr) { stack s; vector ans; for(int i=2*N-1; i>=0; i--) { if(s.empty()) ans.push_back(-1); if (!s.empty() && s.top() > arr[i%N]) ans.push_back(s.top()); else if (!s.empty() && s.top()
@NitinKumar-sx6jl2 жыл бұрын
Please continue the series bhaiya great work
@manjeetkagada75343 жыл бұрын
You are on next level man
@ayushgupta8538 Жыл бұрын
*Thank you so much for this awesome video.*
@NikhilTripathy3 жыл бұрын
17:00 this is gem!
@sanjaydas-ck6pm2 жыл бұрын
Great lecture. Small Optimization: First if and else block code are just duplicate code inside the while loop. Optimized code: ===================================== vector vec{ 1,2,0,6,5,4,1 }; vector output; stack stack; for (int i = vec.size() - 1; i >=0; i--) { while (stack.size() > 0 && stack.top()
@Tanm06093 жыл бұрын
very good explanation brother,keep it up and keep uploading
@NidhiSharma-sw4oz2 жыл бұрын
How O(n) complexity ????? There is a while loop inside for loop. So how it is O(n) complexity ?
@UpscWithPavan7 ай бұрын
Nice, Mza Aaya bhai.
@riaria59824 жыл бұрын
Great Explanation! To improve runtime performance don't do reverse, it's better if you insert element : for(int i=input.length-1; i>=0; i--) { while(!stack.empty() && (stack.peek()
@nishant52494 жыл бұрын
your code is not absolutely correct
@saumitrashukla5914 жыл бұрын
@@nishant5249 why? it seems correct
@AdamRubiks2 жыл бұрын
oh damn
@RohitKumar-uc4fw Жыл бұрын
Use this code to directly store from right to left. public static int[] findNextGreater(int[] ar) { int[] result = new int[ar.length]; Stack stack = new Stack(); for(int i = 0; i < ar.length; i++) { while(!stack.isEmpty() && ar[i] > ar[stack.peek()]) { int index = stack.pop(); result[index] = ar[i]; } stack.push(i); } while(!stack.isEmpty()) { int index = stack.pop(); result[index] = -1; } return result; }
@urtech58864 жыл бұрын
Bhai bs aap videos bnana band mat kro Continue Great job
@avinashsaklani2 жыл бұрын
great explanation
@kapishsingh3 жыл бұрын
its the first chanal in which i done like share and subscribe in less than 1 ms
@SanjuKumar-ye8xz3 жыл бұрын
Brother, tumne alag se vector define kiya jisase eski space complexity increase ho rhi hai.
@supritchafle37064 жыл бұрын
best explanation on stack quns...
@kuldeepnarayanminj4 жыл бұрын
ekdum tabahi video
@Akshat-tz2de Жыл бұрын
Just a small doubt if we have used only 2 loops and used break in 2nd loop when condition is met then also we could have attained same complexity. As you are also using while loop inside for loop which is running for same time that the another for loop will run and for same amount of iterations. Moreover we are using stack here hence increase in space complexity as well.
@sandip_kanzariya84762 жыл бұрын
Head's of brother 👌🙏
@muhammedrameez6523 жыл бұрын
Great Work bro! It really helped me
@tusharjain56583 жыл бұрын
really this explanation is amazing
@annuagarwal84382 жыл бұрын
I am lucky to find your videos. Thank you for making such helpful videos. Your experience will be helpful to lot of people. Please make videos in graphs and backtracking also. I know you wont have much time. But ek mahine mai do video hi daal dena..We will wait. Thanks again😇
@375_rishavmishra94 жыл бұрын
Bro ur great one of best teaching style.♥️♥️hope that you will continue with graph and trees also.
@shubhamdevrani72514 жыл бұрын
Hey bro just loved ur solution for the problem...
@ajeetworking4 жыл бұрын
Thank you for the explaination. We can also approach this without reversing the array as vector nextLargerElement(long long arr[], int n) { stack stk; stk.push(0); vector ans(n, -1); for (int i = 1; i < n; i++) { while (!stk.empty() && arr[stk.top()] < arr[i]) { ans[stk.top()] = arr[i]; stk.pop(); } stk.push(i); } return ans; } in this, we push the element in the stack only if it is smaller than the previous element and if next is greater then we start popping until no further element is greater than the current element.
@sayantaniguha85193 жыл бұрын
non linear time complexity
@jatinkumar44102 жыл бұрын
amazing explanation....
@imamit1002 жыл бұрын
why did you stopped making videos , Aditya, please begin it again. please make these kind of worthful videos on other data structure like, array, string, linked list, queue etc. thanks
@koushik78574 жыл бұрын
fabulous explanation!!!!
@garimadubey89704 жыл бұрын
Thank you sir its very helpful vedio for us..nice explanation.
@rookieslave-kl9cq4 ай бұрын
dimag khul gaya bhai dimag khul gaya
@anuraagch904811 ай бұрын
Python implementation a = [1, 5, 6, 6, 7, 3, 4, 12, 19, 0, 1] stack = [] res = [] # loop over every element for i in range(len(a) - 1, -1, -1): # check if stack is empty and check top element while stack and stack[-1]
@aniketsinha28262 жыл бұрын
greatly explained !!!
@bhawnabharti43693 жыл бұрын
best explanation
@mrsmurf911 Жыл бұрын
Thank you very much *God of DP*
@manshushivam2952 жыл бұрын
man you won my heart
@hiteshwarmehla2267 Жыл бұрын
Java Code : public class NextLargestElement { public static void main(String[] args) { int[] arr = {1,3,0,0,1,2,4}; int[] result = getGreaterToRight(arr); } static int[] getGreaterToRight(int[] arr){ Stack stack = new Stack(); int size = arr.length; int[] result = new int[size]; for(int i = size-1;i>=0;i--){ while (!stack.isEmpty() && stack.peek()
@Newgen123Blogspotawaytosuccess4 жыл бұрын
These are the best video series that is available till Date. Also, make your account premium so that you can continue your work in a more focussed manner. Great work. Ready to pay thousands for such beautiful content.