Пікірлер
@kbcoder3734
@kbcoder3734 3 сағат бұрын
Best explanation for monotonic stack
@Its_Shubham_Negi
@Its_Shubham_Negi 16 сағат бұрын
Thnk u bhaiya :heart
@piyushsingh4558
@piyushsingh4558 18 сағат бұрын
Furthur space optimization is possible TC-O(n) SC-O(1) class Solution { public: vector<int> finalPrices(vector<int>& prices) { int n = prices.size(); vector<int> ans (n); ans[n-1]=n; for( int i = n-2 ; i>=0 ; i--){ int j=i+1; while(j<n&&prices[j]>prices[i]){ j=ans[j]; } ans[i]=j; } for(int i=0;i<n;i++){ if(ans[i]>=n){ ans[i]=prices[i]; }else{ ans[i]=prices[i]-prices[ans[i]]; } } return ans; } };
@piyushsingh4558
@piyushsingh4558 19 сағат бұрын
space optimization , Mind blown
@tuanhungphamcong1340
@tuanhungphamcong1340 Күн бұрын
no DSU :((
@SumitYadav-q4s2s
@SumitYadav-q4s2s Күн бұрын
can we use dp here?
@debyet017
@debyet017 Күн бұрын
Amazing explanation! was able to implement it on my own, the breakdown of logic into steps really helps a lot.
@drugzgamerz7348
@drugzgamerz7348 Күн бұрын
Great explanation
@vaibhavmistry-v6h
@vaibhavmistry-v6h Күн бұрын
Thanks man .I was stuck on this but your one statement explained me the whole problem solution .
@KR_Technical-hj3bf
@KR_Technical-hj3bf Күн бұрын
nice video
@ahappyperson6530
@ahappyperson6530 Күн бұрын
Please make a video on last LC weekly contests solutions. B was really interesting and code heavy
@study-yd6es
@study-yd6es Күн бұрын
Thanks Aryan for this tutorial <3 I wouldn't know that we can use map greater<char>. Thankyou again for this amazing tutorial.
@sankar6934
@sankar6934 Күн бұрын
Thank you for posting videos on a daily basis! Even though I often struggle with the daily challenges, watching your approach to problem-solving has helped me overcome my fear and start thinking about the best possible solutions. I have one request: could you please solve it in Java or at least provide an overview? Thanks, and keep coding 😄!
@RoniBadgujjar
@RoniBadgujjar Күн бұрын
thanks bro for this amazing content please keep it we really need your kind of peoples and your explaining style is also very well i totally get the idea
@esseclues2873
@esseclues2873 2 күн бұрын
when i=s.length(); then It will give ArrayOutOfBoundIndex
@kshitijvarma2566
@kshitijvarma2566 2 күн бұрын
loved the way of explanation..... crystal clear ....
@insofcury
@insofcury 2 күн бұрын
Great Intuition
@floatingpoint7629
@floatingpoint7629 2 күн бұрын
great video with the dry run example. the deque diagram was a little confusing but good explanation overall
@palashdas7203
@palashdas7203 3 күн бұрын
Tell me one Thing ...... The hook is at (6,8) , Bishop is at (6,6) and the queen is at (6,3) Now Would you Please write just the moves here ....
@palashdas7203
@palashdas7203 3 күн бұрын
Thanks for your Concept .... Yes I got it
@princeprabhat9323
@princeprabhat9323 3 күн бұрын
for the last solution, we don't need two sets instead, we can have one set and run loop over the array. Once the element is found in the set we can push it to our answer array and delete that element from the set. So that, next time same elements comes which we have already inserted in our array, we will not push because it is not in the set.
@sanskarjain5394
@sanskarjain5394 3 күн бұрын
I recently started watching your video and I love how to explain things. Keep going BOSS 👌👌
@ShashikantPawar-g5u
@ShashikantPawar-g5u 3 күн бұрын
@AryamMital Can you comeup with some c++ cour se
@kgjr.6224
@kgjr.6224 3 күн бұрын
Love your Content bro. 👊 👊 😎 😎 Keep doing this,
@pruthvinarayana9568
@pruthvinarayana9568 3 күн бұрын
I am using Python 🤡
@abinash1878
@abinash1878 3 күн бұрын
In the priority queue loop, why you are calculating the gain with adding 1 to pass and total?? You are adding it in the calculategain method right??
@syedanwar5647
@syedanwar5647 3 күн бұрын
Who else has seen Aryan's id in today's leetcode solution section.😅
@Zomb-zj4ip
@Zomb-zj4ip 3 күн бұрын
THE GOAT IS BACK TO CPP LETSGOOOOOOOOOOOOOOOOOO
@jitushekkumar7083
@jitushekkumar7083 3 күн бұрын
please solve locked problems as well .
@chitrapandey7255
@chitrapandey7255 3 күн бұрын
has he started writing code in Cpp now?
@sarankumaar6009
@sarankumaar6009 3 күн бұрын
great explanation bro thanks for the video :)
@urdaddy8520
@urdaddy8520 3 күн бұрын
bhaiya plz do leetcode 1595, I need ur explanation
@Anonymous____________A721
@Anonymous____________A721 3 күн бұрын
No need
@urdaddy8520
@urdaddy8520 3 күн бұрын
@@Anonymous____________A721 if u don't need, don't comment unnecessarily
@urdaddy8520
@urdaddy8520 3 күн бұрын
@@Anonymous____________A721 If u don't need just shut ur mouth
@leepakshiyadav1643
@leepakshiyadav1643 3 күн бұрын
amazing and detailed explanation 👏👏
@Nutrino259
@Nutrino259 3 күн бұрын
I want to know what is/was your highest POTD streak on leetcode???
@Akash.B28
@Akash.B28 3 күн бұрын
Very good explanation!!!
@anandsingh-mp4zv
@anandsingh-mp4zv 4 күн бұрын
awesome, let me ping the entire code here struct FT{ vector<int> bit; int n; FT(int sz){ n = sz; bit.resize(sz + 1, 0); } void add(int indx, int val){ while(indx <= n){ bit[indx] = max(bit[indx], val); indx += indx & -indx; } } int get(int indx){ int mx_val = 0; while(indx > 0){ mx_val = max(mx_val, bit[indx]); indx -= indx & -indx; } return mx_val; } }; class Solution { public: vector<bool> getResults(vector<vector<int>>& queries) { ios_base::sync_with_stdio(false); int n = min(3 * (int)queries.size(), (int)5e4) + 1; set<int> obstacles; FT ft(n); obstacles.insert(0), obstacles.insert(n); for(const auto &q: queries){ if(q[0] == 1){ obstacles.insert(q[1]); } } for(auto it = obstacles.begin(); it != obstacles.end(); ++it){ if(it == obstacles.begin()) continue; ft.add(*it, *it - *prev(it)); } vector<bool> res; for(int i = queries.size() - 1; i >= 0; --i){ vector<int> &q = queries[i]; if(q[0] == 1){ int x = q[1]; auto it = obstacles.find(x); auto nxt = next(it); auto prv = prev(it); ft.add(*nxt, *nxt - *prv); obstacles.erase(it); } else{ int x = q[1], sz = q[2]; auto it = prev(obstacles.upper_bound(x)); int mx_sz = max(ft.get(*it), x - *it); res.emplace_back(mx_sz >= sz); } } reverse(res.begin(), res.end()); return res; } };
@mageshyt2550
@mageshyt2550 4 күн бұрын
love the two pointer explanation 💝
@vaibhav8257
@vaibhav8257 4 күн бұрын
Nice to see you Back
@Axel.Blazer
@Axel.Blazer 4 күн бұрын
in your approach 5 i thought we could do better by storing just the last index of curmin and curmax..that'd speed it up a bit i guess but idk
@mandartule
@mandartule 4 күн бұрын
@JitendraSingh-t7w9c
@JitendraSingh-t7w9c 4 күн бұрын
I think in deque approach shrinking the window by hop is same as shrinking it one by one. Please help if anyone have code of shrinking window one by one.
@SreeCharan-dx7oc
@SreeCharan-dx7oc 4 күн бұрын
vielen dank
@GauravPrasad-m1j
@GauravPrasad-m1j 4 күн бұрын
bitte
@nagasrisaichaitanyakolluri8173
@nagasrisaichaitanyakolluri8173 4 күн бұрын
when i struggle , your videos r wat to go
@swapnil_tayal
@swapnil_tayal 4 күн бұрын
which mic are you using ? thanks in adanvace