Remove K Digits | Intuition | Dry Run | Leetcode 402 | codestorywithMIK

  Рет қаралды 12,049

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 147
@wearevacationuncoverers
@wearevacationuncoverers 6 ай бұрын
Stack jaae bhaad me. 🤣🤣🤣 Koi aapki tarah parha nahi sakta bhai. love you
@ankanbrahmachary6581
@ankanbrahmachary6581 6 ай бұрын
explaining code is for kids ..Legends build intuition from ground up .. 🔥🔥🔥🔥🔥🔥"bhadme jae stack"
@akshanshsharma6025
@akshanshsharma6025 6 ай бұрын
bhai maine kam se kam 10 article padhe par kahi bhi intution nahi mili phir last m video dekhi aur inution samzi aur code khud se likh liya heads off you brother
@gauravbanerjee2898
@gauravbanerjee2898 6 ай бұрын
Literally itna details mei youtube mei time leke koi nahi padhata, direct approach batake 10-20 mins mei video khatam kar dete hai . Thanks a lot bhaiya for your efforts Love you 3000❤❤ and Eid mubarak❤🌙✨
@atulkumarpandey3342
@atulkumarpandey3342 6 ай бұрын
Bhai ekdm crystal clear samjhate ho, Love you brother ❤❤
@pokeindia5361
@pokeindia5361 4 ай бұрын
Best video of entire DSA community among all DSA channels in youtube..
@theoffshoregaming
@theoffshoregaming 6 ай бұрын
Thumbnail khtrnaak h bhai😂😂
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
😅
@yourcoderboy
@yourcoderboy 6 ай бұрын
Love from Bangladesh ❤️
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Love from 🇮🇳 😇😇❤️❤️
@paveshkanungo6338
@paveshkanungo6338 6 ай бұрын
Your videos are toooooo good. Many students are with youuu. 🤯🤯🤯💥💥💥💥💥💥💥💥💥💥
@RishabhChatterjee-fg2gz
@RishabhChatterjee-fg2gz 2 ай бұрын
Awesome explanation ❤❤
@rohanpagare3786
@rohanpagare3786 6 ай бұрын
bhai, bohot sahi explanation kiya he aapne, thank you bhai.
@kareni7572
@kareni7572 4 ай бұрын
Amazing! This place value is similar to “Next greater element III”
@cllabnatin5121
@cllabnatin5121 2 ай бұрын
Waah explaination better than striver, Great brother you made every problem looks easy.
@harshitshrivas5444
@harshitshrivas5444 2 ай бұрын
He teaches good and explain very nice .. but there is no comparison of striver 😊
@RishabhChatterjee-fg2gz
@RishabhChatterjee-fg2gz 2 ай бұрын
​@@harshitshrivas5444 striver bhai is question ko direct stack mein intuition build karaya isiliye bol rage hai
@harshitshrivas5444
@harshitshrivas5444 2 ай бұрын
@@RishabhChatterjee-fg2gz if you are know some about coding and then you practice striver he is best because its question choice and all are no comparison. He explained well no doubt but why comparing with the person with best playlist all over KZbin tuf and tuf+
@devshubham5528
@devshubham5528 4 ай бұрын
amazing explanation, subscribe to banta hai (done✅)
@gui-codes
@gui-codes 6 ай бұрын
Truly the Intuition God
@32bhogawaraniketanil82
@32bhogawaraniketanil82 6 ай бұрын
I always love ❤ the way you explain the question, the intuition, and then the code.. Thank you very much for such amazing content.
@ananttripathi4023
@ananttripathi4023 3 ай бұрын
Bro ur content quality is soo soo much good.
@manassalunke1755
@manassalunke1755 2 ай бұрын
Thanks bro, great work.
@fshimcds
@fshimcds 6 ай бұрын
Best Teacher ever😊
@RishabhDhiman-zf5wd
@RishabhDhiman-zf5wd 6 ай бұрын
Really great way to explain and approach problem 🙌🙌.
@sadafkausar8770
@sadafkausar8770 6 ай бұрын
Eid Mubarak bhayya 🌙 🌙 You are soo good making vedio for us on this day also .
@Sahilsharma-sk5vr
@Sahilsharma-sk5vr 4 ай бұрын
keep making videos like this .
@biswarupacharjya2258
@biswarupacharjya2258 6 ай бұрын
you are my best teacher
@devgupta7290
@devgupta7290 6 ай бұрын
crazy explanation best one hands down 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
@chethangowdahr7653
@chethangowdahr7653 6 ай бұрын
bro, ur explanation is very good... nice video
@subhajitdey135
@subhajitdey135 6 ай бұрын
Hats off to your explanation ❤
@AnjuGupta-sz1uk
@AnjuGupta-sz1uk 6 ай бұрын
Really liked this approach of solving this problem... Bhaiya you are great , your explanations are best😊
@Virtualexist
@Virtualexist 2 ай бұрын
Niceee! I implemented it on my own using the approach, but I modified original input instead. string removeKdigits(string num, int k) { for(int i =0; i(int)num[i+1] && k>0 ) { num.erase(i,1); i--; k--; } else i++; // agar index out of bound chale gaye less than 0 toh.. if(i0) num = num.substr(0,num.size()-k); // just to remove leading zeros int leading = 0; while (num[leading] == '0') leading++; if(leading) num.erase(0, leading); // agar sabhi kuch remove ho raha hai, toh.. if(!num.size()) num = "0"; return num; }
@rushikesh_nale07
@rushikesh_nale07 6 ай бұрын
BESTESTT EXPLAINATION!❤❤❤
@YashSinghal
@YashSinghal 6 ай бұрын
your intuition explanations are best!
@MEBSonukumar
@MEBSonukumar 6 ай бұрын
thank you bhai for clearing T.C. Confusion
@ayoobraza8790
@ayoobraza8790 6 ай бұрын
Sir we need this type Intuition it's great 👍 100% understand basic to advance thanks you Sir
@study-yd6es
@study-yd6es 6 ай бұрын
Amazing Explainationssss ❣❣
@ajinkyakhete1151
@ajinkyakhete1151 6 ай бұрын
I don't know you will read my comment or not but your explanations are the best, literally your tone of speaking , interaction with audience. Literally I have don't have words to say hats off brother .... Keep it up ☺️
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
😇🙏❤️
@hemendrachaudhary3263
@hemendrachaudhary3263 6 ай бұрын
bhaiii yar tum aadmi OP ho
@aryangupta-sv8vb
@aryangupta-sv8vb 6 ай бұрын
nice yaar.. really aaj frustate hi hi gya tha
@mursalinhawlader6407
@mursalinhawlader6407 6 ай бұрын
you deserve more subscriber
@JatinGupta-ze6nc
@JatinGupta-ze6nc 6 ай бұрын
thanks bhai for making me consistent
@ayaanrashid960
@ayaanrashid960 6 ай бұрын
Eid Mubarak Bhai 🌙
@achrajpachauri3494
@achrajpachauri3494 6 ай бұрын
Best Explaination !!!
@labadepradip7734
@labadepradip7734 6 ай бұрын
aaj pata chala ki school ke basics kis tarah se use kar sakate hai is question me aur monotonic ka dr khatam ho gaya 🙂🙃
@raftywate
@raftywate 6 ай бұрын
Eid mubarak, bhaijaan!🌛
@Chitranshu972
@Chitranshu972 6 ай бұрын
Best Explanation
@sonalkolhe4537
@sonalkolhe4537 6 ай бұрын
Best Explanation🔥🔥🔥
@nikhilhaspe2734
@nikhilhaspe2734 6 ай бұрын
amazing Guru!
@tutuimam3381
@tutuimam3381 6 ай бұрын
Amazing explanation ❤❤
@sailikpandey
@sailikpandey 6 ай бұрын
Great Explanation Sir
@yogeshchauhan9401
@yogeshchauhan9401 6 ай бұрын
Very Intuitive Solution 👍👍Can you upload leetcode 729 too ?😅
@vishalsisodiya28
@vishalsisodiya28 6 ай бұрын
Thank u so much bhaiya ❤
@akbar55555shaikh
@akbar55555shaikh 6 ай бұрын
you simply beat the explanation of all other KZbin channels. All teach how to solve the problem, but you show how to build it. In your case, DS comes later because that can be self-understood which DS to use.
@EB-ot8uu
@EB-ot8uu 6 ай бұрын
you are legit bro.
@prathamcreator1043
@prathamcreator1043 6 ай бұрын
great solution bhaiya
@aizad786iqbal
@aizad786iqbal 6 ай бұрын
amazing explanation thank you I tried to solve this earlier without watching any videos... I was trying to remove consecutive numbers only, when my code started failing earlier then I realize it was wrong one doubt, when k>0 , e.g. 123678 after traversal we are removing from the back and not considering the place value here I can see from example those are the largest numbers but earlier place value was more important hence confused, so please explain
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
When a number is already in ascending order then removing from front will be better because we already have lower numbers in most significant places and don’t want to get rid of them. For example : “1234” , K = 2 If you remove from front - “34” If you remove from back - “12” Obviously second one is smaller.
@tanujamehra608
@tanujamehra608 6 ай бұрын
It really helps me
@vm0305
@vm0305 6 ай бұрын
I am not sure about my approach, but tried using sliding window of k size here, like for input num = "1432219", k = 3, we have windows 143, 432, 332, 221, and 219. Out of these, max one is 432. So, its removal gives 1219. When I implemented it, it gave TLE at last testcase 😅
@SumitKumar-du6vf
@SumitKumar-du6vf 6 ай бұрын
yeah me too trying to do this but unable to implement it. Can you share your code here
@dss963
@dss963 6 ай бұрын
That is not always gonna give you correct answer
@bhuppidhamii
@bhuppidhamii 6 ай бұрын
Eid Mubarak
@AmanKumar-qz4jz
@AmanKumar-qz4jz 6 ай бұрын
bhaiya apne aapna intution itna acha kaise bana rakha h
@swagboltey102
@swagboltey102 6 ай бұрын
Eid Mubarak ✨ Bhai ❤️
@kunalpatil.24
@kunalpatil.24 6 ай бұрын
Stack jaae bhaad me. 😂 Thank You!
@ugcwithaddi
@ugcwithaddi 6 ай бұрын
Was waiting 🎉for
@jashanjotbedi1796
@jashanjotbedi1796 6 ай бұрын
Please make video on 877 stone game question from leetcode .
@8daudio672
@8daudio672 6 ай бұрын
❤🪄ur magesian sir🎉
@DevOpskagyaan
@DevOpskagyaan 6 ай бұрын
Eid Mubarak bro. Aaj bhi video daaldiya 🥺
@coderletscode
@coderletscode 6 ай бұрын
Eid Mubarak❤
@advitkothari7302
@advitkothari7302 3 ай бұрын
gr8!!
@CodeMode9313
@CodeMode9313 6 ай бұрын
Mast paaaji ....Eid mubarrak saar
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Eid Mubarak 😇❤️
@abhinay.k
@abhinay.k 27 күн бұрын
thank you
@xyzhwhs
@xyzhwhs 6 ай бұрын
Used dynamic programming , 23/43 test cases passed
@8daudio672
@8daudio672 6 ай бұрын
Happy Eid sir❤
@kunalpatil.24
@kunalpatil.24 6 ай бұрын
Eid Mubarak!!!
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Eid Mubarak ❤️❤️🌙🌙
@JatinGupta-ze6nc
@JatinGupta-ze6nc 6 ай бұрын
Bhai leetcode 53 kadane algorithm p ek video dalo please begineer se advance tk
@bhuppidhamii
@bhuppidhamii 6 ай бұрын
aaj pahli baar school m padha hua kaam aya 😅😅
@atanubasak7244
@atanubasak7244 6 ай бұрын
I see future Coding Carryminati in your video
@JagannathDebGunin
@JagannathDebGunin 6 ай бұрын
Eid Mubarak dada❤
@virendratambavekar61
@virendratambavekar61 6 ай бұрын
Bhaiya Leetcode Q. No. 25 (Remove Nodes in K Group ) ka easy approach bato na
@31parvjain32
@31parvjain32 6 ай бұрын
Provide these slides link well It will be really helpful
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Sure thing. I am a little occupied now, I will share the slide link tonight for sure ❤️❤️
@closer9689
@closer9689 6 ай бұрын
Aaj lga ki code krna bhi entertaining ho skta hai>>> Kyoki Nyi Nyi stories sunna kisko nhi Pasand😂
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
So guys, “Aao, story se code likhe” 😁❤️
@pradeepranjan8226
@pradeepranjan8226 6 ай бұрын
i submitted wrongly 6 times, coz of those shitty corner cases. But how do we know in real interview that these many corner cases are actually exist in the problem?? Finding all corner cases are not easy sometime, thats what i feel.
@anandoganiya9070
@anandoganiya9070 6 ай бұрын
Bro maximum wins from two segment ye wala question karo please
@RajanSahu-z5i
@RajanSahu-z5i 6 ай бұрын
Love u bro, happy ugadi
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
❤️❤️😍😍 Happy Ugadi
@gyandyan
@gyandyan 6 ай бұрын
bhai yaar apan ko string de rki h like-"1432219" toh sabse chota Number jo ban sakta h vo toh ---"1122" here i remove 4,3,9... why this was not a answer ?? please tell me
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
You can’t rearrange the number.
@abcd76820
@abcd76820 6 ай бұрын
mzaa aaya ❤
@chitranshjain9714
@chitranshjain9714 6 ай бұрын
Please complete dp concept series
@wearevacationuncoverers
@wearevacationuncoverers 6 ай бұрын
yes please sir @codestorywithmik
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Sure. Next video Coming this weekend
@solosanskar490
@solosanskar490 6 ай бұрын
Stone Game 7 pe ek video bna do sir please
@DeveloperRB
@DeveloperRB 6 ай бұрын
understood
@shreyrawat7108
@shreyrawat7108 6 ай бұрын
Respect
@Ramgangakumar
@Ramgangakumar 3 ай бұрын
aapka video kaafi long hota h thoda short banao sir...
@VM-ek7td
@VM-ek7td 3 ай бұрын
😊😊
@xyzhwhs
@xyzhwhs 6 ай бұрын
Dynamic programming is more intutive
@vidishajahanvi4948
@vidishajahanvi4948 6 ай бұрын
please solve in java also
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
I will definitely try to cover java coding in future videos. As of now, I put C++ as well as JAVA code in the github link in the description 😇🙏
@manishkumarnirmalkar5633
@manishkumarnirmalkar5633 6 ай бұрын
Bhaiya but sabse chota to 1123 ho ga na
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
You can’t rearrange the digits in the string
@AmruthavarshiniMavuri
@AmruthavarshiniMavuri 6 ай бұрын
Bhaiyya can you explain in English in your videos
@aa_maruf
@aa_maruf 6 ай бұрын
❤❤
@CSERITIKSINGH
@CSERITIKSINGH 6 ай бұрын
sir please give notes of ipad pdf it is very helpful for revision
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Sure thing. I am a little occupied now, I will share the slide link tonight for sure ❤️❤️
@CSERITIKSINGH
@CSERITIKSINGH 6 ай бұрын
Bhaiya please daily pdf bhide diya kro bahut help hoti hai kyo ki samajh me AA jata hai par revision ke liye best rahta hai
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Sure. Thing Let me upload the PDF for yesterday now. Also you can check here for other PDFs that I have uploaded. I will upload more in future also with every video
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Added 👍🏻
@ayushsrivastava2829
@ayushsrivastava2829 6 ай бұрын
full dsa laooo
@souravjoshi2293
@souravjoshi2293 6 ай бұрын
thumbnail 😂🔥🔥
@factinsaan4333
@factinsaan4333 6 ай бұрын
class Solution { public: string removeLeadingZeros(string &str) { size_t pos = str.find_first_not_of('0'); if (pos !=string::npos) { return str.substr(pos); } return "0"; } string removeKdigits(string num, int k) { if(k==num.length()) return "0"; string st=""; int i=0,n=num.length(); while(i
@dhruvrawat7023
@dhruvrawat7023 6 ай бұрын
class Solution { public: string removeKdigits(string num, int k) { string fa = ""; int n = num.size(); for(int i = 0; i < n; i++){ while(fa.size() > 0 && fa.back() > num[i] && k > 0){ fa.pop_back(); k--; } if(fa.size() > 0 || num[i] != '0'){ fa.push_back(num[i]); } } while(k > 0 && fa.size() > 0){ fa.pop_back(); k--; } if(fa.size() == 0){ return "0"; } else{ return fa; } } };
@karnikasingh9140
@karnikasingh9140 6 ай бұрын
💯💯💯💯💯💯
@gauravparasar4571
@gauravparasar4571 6 ай бұрын
class Solution { public: string removeKdigits(string num, int k) { string res = "" ; for( int i=0 ; i 0 && res.back() > num[i] && k>0) { res.pop_back() ; k-- ; } if( res.length() > 0 || num[i] != '0') { res.push_back(num[i]) ; } } while( k > 0 ) { res.pop_back() ; k-- ; } if( res == "") { return "0" ; } return res ; } }; why it gives me error ??
@visheshpandey9070
@visheshpandey9070 6 ай бұрын
bcoz for while(k>0) it should be corrected to while(k>0 && res.size()>0)
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 7 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,8 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 9 МЛН
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 32 МЛН
L14. Remove K Digits | Stack and Queue Playlist
15:29
take U forward
Рет қаралды 19 М.
Leetcode 46. Permutations : Introduction to backtracking
10:06
ComputerBread
Рет қаралды 99 М.
Sum of Distances in Tree | Google | Leetcode 834 | codestorywithMIK
44:46
Viral Video of a Man's Crazy Job Interview
16:02
Darryl Vega TV
Рет қаралды 1,3 МЛН
678. Valid Parenthesis String | DP | Stacks | 2 Pointers | 3 Ways
38:32
LRU Cache | Brute Force | Optimal | Detailed | Leetcode 146
40:32
codestorywithMIK
Рет қаралды 16 М.
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 7 МЛН