Har topic ko apne bahut achche se explain kiya. Now you are my favourite teacher.
@AyushKumar-fk5lm3 жыл бұрын
Sumeet sir is a gem! Waiting to see amazing Pepcoding team hitting 50k subscribers in 24-48 hrs!!
@Pepcoding3 жыл бұрын
Hope so Beta. keep motivating, keep learning and keep loving Pepcoding😊
@travelnlearn Жыл бұрын
Aap jaisa sir ho toh koi bhi subject samjh aayega hi aayega Love you sir ♥️
@444not3 жыл бұрын
Thanks for all your effort. Your teaching style in really amazing. I am learning a lot. Cannot thank you enough. I have watched the same approach in a different video, but it didn’t stick. Watching you solve this 5 times made me understand the concept very well.
@AmanTheMystery3 жыл бұрын
sumit sir is king sir itna deep koi nhi smjta sir . esa lagta hai jese aap k samne baith k class le rhe hai thank u sir hum bacho ko itna acha content dene k liye
@Pepcoding3 жыл бұрын
Thank you so much for appreciating and If you like the content could you post something on LinkedIn about us? This will help us in reaching out to more people and help a lot of other students as well Something like this Sumeet Malik from Pepcoding is making all his content freely available to the community You can check it out here - www.pepcoding.com/resources / Also, this is the youtube channel - kzbin.infoplaylists?view_as=subscriber
@kandurimanohar82113 жыл бұрын
I understood the concept what you explained sir but I didn't understood the reason for Implication why we are doing v+v-m when v
@Jaganantpatil67118 ай бұрын
This trick is to find previous min when you do pop() to achieve complexity
@bloody91623 жыл бұрын
The What, How and Why is Gold. I'm going to apply this to other aspects of my life as well :)
@Pepcoding3 жыл бұрын
Glad it helped, for better experience, doubt support and career opportunities with same but well-organised content, visit - nados.pepcoding.com Don't forget to follow us on Instagram instagram.com/pepcoding/
@Pepcoding3 жыл бұрын
Means a lot! Also for better experience and well-organised content Visit - nados.pepcoding.com Don't forget to follow us on Instagram instagram.com/pepcoding/
@GyaanGrave2 жыл бұрын
This is some amazing teaching. God gifted.
@stith_pragya Жыл бұрын
Thank You So Much Sumeet Sir...........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@dheerajkhushalani26193 жыл бұрын
amazing question to solve.. thank you sir for your explanation..
@mohitahlawat49443 жыл бұрын
woahh out of the box explanation sir, thanks for such great content
@mrityunjayjaiswal38012 жыл бұрын
Awesome sir. From TOday i am your big fan
@ParasVashishth_RV3 жыл бұрын
Sir, very nice logic, will keep a note of this method. Thnx
@ParasVashishth_RV3 жыл бұрын
but max stack ka aise direct toh ni milrha logic
@Pepcoding3 жыл бұрын
Thanks buddy! I am glad you liked it. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms ) Keep learning and keep supporting Pepcoding😊
@sarthaktripathi4683 жыл бұрын
sir iss question ko to sidha bhi kar sakte the, min variable banate and stack 1)pahale dono mei data push karte. 2) jab next bar data push karte to min se compare kar lete 3)agar min se chota aat to min to update kar lete. fir shyad v+(v-min) karne ki jarurat nhi pdhti?
@chetanmehta39573 жыл бұрын
There would be problem when the min element gets popped. U will not know about the next min if you dont maintain the state through the formula in the stack itself
@SCRIPTSAG4 жыл бұрын
Sir mst explain kiya sir ds algo ka bahut use hota hoga industry me time space ke term me ye code chela do to shi hi hai na sir time bachega hi
@swatidubey4932 жыл бұрын
thank you so much sir for this amazing explanation .
@travelnlearn Жыл бұрын
Will definitely grab a pbc and come and talk to you sir
@DataMetricsSolutions3 жыл бұрын
You are my GOD sir
@prateekbansal20143 жыл бұрын
Sir isme aapne val+val - min kra ..... agar sirf val - min kre to bhi code chal rha hain correct ans aa rha hain ... to kya val - min bhi sahin hain ??
@prateekbansal20143 жыл бұрын
Well I just do dry run for val-min case .... in case of negative numbers val-min will fail but val+val-min will work
@namanagrawal48682 жыл бұрын
thanks for the explaination :)
@adityagupta18053 жыл бұрын
Awsm logic
@codemaestro99044 жыл бұрын
Awesome explanation sir. I tried this approach on leetcode but it failed on 1 testcase: push(2147483647) (Integer.MAX_VALUE) push(-2147483648) (Integer.MIN_VALUE) min() top() pop() I think there's some overflow here. Sir could you help me understand the problem in this case?
@Pepcoding4 жыл бұрын
beta long use kar le. pass ho jaega.
@ankitkumarmahato43183 жыл бұрын
@@Pepcoding nhi ho rha sir
@Anonymous_Coder2 жыл бұрын
@@ankitkumarmahato4318 Try to make stack of long long and mini of also long long .. It will definitely pass.
@zonemasterindia2 жыл бұрын
not working on LeetCode
@AKASHKUMAR-li7li6 ай бұрын
but sir, this solution might give integer overflow....... error , in case the number in int_min how to solve that issue
@akashkumar-kz3ch4 жыл бұрын
sir, but can we put display function in min stack class and what logic we be applied in that
@Pepcoding4 жыл бұрын
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding. Also, we have a premium facility available for the students in which you can get the 12 hours doubt support facility. Jisme aap agr kisi bhi question main kahin bhi faste ho to aap doubt support par reach kar skte ho aur aapko TA assign ho jayega and you can get your doubt resolved from them.
@vishalsingh24083 жыл бұрын
Very detailed and nice explaination
@Pepcoding3 жыл бұрын
Thanks buddy! Keep watching and keep learning😊
@lakshayrastogi23473 жыл бұрын
SIR yeh sb humne bs O(1) LAANE k liye kia h n?
@prateekbansal20143 жыл бұрын
sir yeh technique apne sochi kese ?? kya pehle se hi exist krti thi ya apne khud bnayii ... khud bnayii to kya logic lgaya ??
@Pepcoding3 жыл бұрын
Post your doubts on nados.pepcoding.com our community will help you out.
@codemaestro99044 жыл бұрын
Sir agar min ki jagah max stack bnani hoti toh kya store krte ?
@Pepcoding4 жыл бұрын
1 trick could be to change the sign of numbers. while taking a number multiply by -1 and while giving back again multiply by -1
@Pepcoding4 жыл бұрын
now min stack will behave like max stack. keep rest of the logic same.
@codemaestro99044 жыл бұрын
Thanks sir :)
@entertainshala2 жыл бұрын
Hi, why did you use v+v-m but now v-m??
@kashba2 жыл бұрын
negative values ke liye dry run karo. fail kar jayega push -> 30, 5, 17, -1, -3, 10 and do it with v - m method. it will fail. Hmara goal hota hai detection ke liye value bnana jab value in st < min hogi tab hmara original value current min se kam value aayi hogi but it won't work with v - m
@LegitGamer23454 жыл бұрын
awesome!
@Pepcoding4 жыл бұрын
Thank you! Cheers!
@anubhavtyagi65023 жыл бұрын
sir using min variable won't affect the space complexity?
@aahanaganjewar99512 жыл бұрын
No
@yashgupta96773 жыл бұрын
Sir humne isme v+v-m hi kyu kara?? v-m se bhi krskte h na?
@chetanmehta39573 жыл бұрын
Yadi dono no- v, m negative honge toh simple v-m kam nahi karega
@_s_h_l_o_k_3 жыл бұрын
Liked the content sir, But can we add one variable previousMin and while popping if min==stack.peek() then we'll update min from previous min. Its still O(1) complexity...?
@Pepcoding3 жыл бұрын
For such query visit on nados.pepcoding.com, you can post your query on Community tab. And you will find better experience with organised content. Don't forget to follow us on Instagram instagram.com/pepcoding/
@SCRIPTSAG4 жыл бұрын
Sir pichle logic aur es logic me bas yhi difrence hai ki jeb hem pus kerta hai to extra space ke liye stack me save nhi ker rha hai bali uski stack me save kerke aur fir se pta kerne ke kiye aisha signature dal rhe hai taki wo fir se mil ske ager hem pop kre to i think yhi difrence hai en dono question me
@Pepcoding4 жыл бұрын
ji bilkul
@SCRIPTSAGАй бұрын
I just got after 4 years mai yhi problem ek bde engineering collage me pdaunga kel