Restore IP Addresses | Recursive Tree | Diagram | META | Leetcode 93

  Рет қаралды 6,388

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 74
@atifhu
@atifhu Жыл бұрын
what an explanation👏
@compiled9787
@compiled9787 Жыл бұрын
I urge everyone to watch full ads in his videos and not skip it...This guy deserves this!
@codestorywithMIK
@codestorywithMIK Жыл бұрын
That’s overwhelming. I want to thank you from the bottom of my heart. That’s very kind ❤️
@nagmakhan3165
@nagmakhan3165 Жыл бұрын
True
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Seriously man. I am really gonna do that for this guy. He deserves it.
@M10-r8q7h
@M10-r8q7h Жыл бұрын
me using adblocker
@NatureLover-oq6uc
@NatureLover-oq6uc Жыл бұрын
Lovely Explanation...Next level Expalnation....maza hii aagya...
@oqant0424
@oqant0424 Жыл бұрын
Finally wait is over
@nagmakhan672
@nagmakhan672 Жыл бұрын
Crisp and perfect. Thanks a lot for the recursive tree explanation and dry run
@krishnenduroy3673
@krishnenduroy3673 3 күн бұрын
Superb explanation
@codestorywithMIK
@codestorywithMIK 2 күн бұрын
Thank you 🙂❤️
@NikhilYadav-cj2jt
@NikhilYadav-cj2jt Жыл бұрын
great explanation, huge respect man seriously 👍 keep posting such videos daily and also imp questions from imp topics and interview perspective
@AmitSaha_15
@AmitSaha_15 8 ай бұрын
this channel is really underrated.... your explanations are crazy good.... thanks for such great contents ❤❤
@shabananoor9423
@shabananoor9423 Жыл бұрын
Wonderful explanation
@amanbalhara7365
@amanbalhara7365 Жыл бұрын
Learned alot of new things from this video, thankyou so much 🥺. You always made everything so ezz...
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Man you are just awesome. I just saw you crossed 2k subscribers. Congratulations and soon you will reach 1M trust me
@JJ-tp2dd
@JJ-tp2dd Жыл бұрын
God Level explanation
@abhinavtomar8518
@abhinavtomar8518 Жыл бұрын
Your explanation is really good bro . Keep bringing such videos
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much 😇🙏
@madhabkafle8898
@madhabkafle8898 Жыл бұрын
Congratulations for 2K, Wish you many more in future.👏👏👏
@tutuimam3381
@tutuimam3381 Жыл бұрын
Thanks a lot
@shubhamsandanshiv515
@shubhamsandanshiv515 Жыл бұрын
Best best bhai keep going👍
@rahuljha972
@rahuljha972 5 ай бұрын
nice explanation
@deeparawat8308
@deeparawat8308 Жыл бұрын
very helpful!! can you please make a vedio on constraints analysis .(how to take help from constraints in solving questions)
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks Deepa. I have planned to make a video on that too soon. Thanks for watching 😇
@anshika3542
@anshika3542 Жыл бұрын
Bestest explanation😇
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you Anshika 😇
@vaibhavgupta973
@vaibhavgupta973 Жыл бұрын
you literally made it really easy !!
@animesh414
@animesh414 Жыл бұрын
you are superbbbb.
@udaytewary3809
@udaytewary3809 Жыл бұрын
Really thankyou bhaiya your explanation helped a lot at first I was not able to even approach the problem but after listening to you for few minutes I began to understand the problem and for that really thankyou bhaiya I will be always great full to you One thing wanted to ask you if this type of question came in online interview then what should we do face that type of situation ?
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Uday During interviews they generally help also , hints are given if you need But it’s important that you atleast share your thoughts out loud
@khushipandey5144
@khushipandey5144 8 ай бұрын
Mannn!!!🙇🏻‍♀️🙇🏻‍♀️ You're the best 🔥🔥🔥
@codestorywithMIK
@codestorywithMIK 8 ай бұрын
🙏🙏❤️❤️😇😇
@Krishna-mz2uk
@Krishna-mz2uk Жыл бұрын
Java Solution as per above Approach: class Solution { int n; List result; public boolean valid(String s) { if(s.charAt(0)=='0') return false; if(Integer.parseInt(s)>255)return false; return true; } public void solve(String s,int i,int parts,String cur) { if(parts>4) return; if(parts==4 && i==n) { //remove the dot result.add(cur.substring(0,cur.length()-1)); return; } if(i+1
@basujain8928
@basujain8928 4 ай бұрын
badhia never give up, one day you will be famous
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
He is back 🔥
@akshayzade9761
@akshayzade9761 Жыл бұрын
Nice approach & Solution If you don't mind can you make 1 video on explaining recursion? Like how generally Recursion are used in leetcode programs, how to think on problems solving from that perspective.. As watching the video I got the hint you will be using recursion but calling recursion 3 times with different parameters etc TBH its hard to trace the calls inside brain n think from that perspective I have started watching this channel start of 2023 I see you release video daily .. It will be tough for you to manage your day IF YOU CAN CREATE VIDEO Then only DO or else its whole fine no issues Thanks Mik 😊
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Hi Akshay, I am soon planning to create playlists on these topics also from scratch. I will just be ok break next month for 3 weeks for travelling, then i will be back again. And definitely i will create videos on what you want. Thanks for watching ❤️❤️❤️
@akshayzade9761
@akshayzade9761 Жыл бұрын
​@@codestorywithMIK - Thanks a lot for your efforts and yaa enjoy your days very well We are not running out 😄Your channel has different uniqueness of "Story To Code" Which makes peeps like me to understand easy You are killing the leetcode discussion section.. Keep it up mate 👍
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot 😇❤️
@wearevacationuncoverers
@wearevacationuncoverers Жыл бұрын
lit
@ugcwithaddi
@ugcwithaddi 9 ай бұрын
Dope 🔥
@jaymishra1781
@jaymishra1781 Жыл бұрын
If possible end me Java ka code v ek baar dikha diya karo, baki you teach really good. Congratulations for 2k
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Sure ❤️
@podilichaitanyaakhilkumar4911
@podilichaitanyaakhilkumar4911 Жыл бұрын
You're awesome. But, Please post videos in English, so that it reaches to wider audience.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Soon I will try to add subtitles. 😇 And make another video in english too
@thevagabond85yt
@thevagabond85yt 9 ай бұрын
Java code using for-loop-recursion & regex : ``` class Solution { public List restoreIpAddresses(String s) { List result = new ArrayList(); int N= s.length(); if (N>12) return result; //empty List solve(s, 0, N, new StringBuilder(), 0, result); return result; } public void solve(String s, int idx, int N, StringBuilder ipSoFar, int octetCount, List result) { // defining : base or termination condition if ( octetCount == 4 && idx == N ) { String validIP = ipSoFar.substring(0, ipSoFar.length()-1);//removes trailing delimeter '.' result.add(validIP); return; } // exploring different considerations : max 3 possible at each stage for(int r=idx+1; r
@Krishna-mz2uk
@Krishna-mz2uk Жыл бұрын
if (parts>4 ) return ; this condition should be added na otherwise it'll call recursion unnecessarily even when we crossed 4Parts
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Yep you can add it too. Good one 👍🏻
@TM-vh1qg
@TM-vh1qg Жыл бұрын
god 🛐🛐
@india9648
@india9648 Жыл бұрын
Bro how do u figure out so many things to solve a prob. I am not able to do that 😢 between congrats for 2k bro u deserve more 🔥
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much. And regarding approaches, I always believe in making story first. And trust me, with time, it will come to you too. Keep practicing
@drbullah1388
@drbullah1388 Жыл бұрын
❤ Ye kal ke question jaisa hua na bhaiya? Ki ham backtracking karre har step pe, ki lenge ya nahi lenge string ko, agar valid hai to append karenge warna nahi
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Yep, you can call it backtracking too.
@shashwats9273
@shashwats9273 Жыл бұрын
Itni sari conditions sochna ....fir usko Code me convert krna kaise kr lete ho aap ....ho hi ni pata mujhse ye jitna bhi khud se likhne ka try kr lu .... 😥😭
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Trust me, keep practicing and it will come soon. Never stop 💪
@shashwats9273
@shashwats9273 Жыл бұрын
@@codestorywithMIK Ok bhaiya 🥰❤
@piyushacharya7696
@piyushacharya7696 Жыл бұрын
Bro why on passing string curr by reference in solve() and isValid() gives an error? I am new to c++ so I didn't get it.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Actually this is this will give error because, you are trying to pass s.substr() which will be of type std::__cxx11::basic_string to &str which is of type std::__cxx11::string& Both are of different type. So, whenever you pass anything by reference, make sure you evaluate the substr (or any operation) and save it in a variable and then pass it. For example : #include using namespace std; void check(string &str) { cout
@piyushacharya7696
@piyushacharya7696 Жыл бұрын
@@codestorywithMIK Bro thanks a lot for describing it so properly even in the comment section. May you get millions of subscribers 💪. 🐐 of DSA explanation.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Shrijal. Glad it helped ❤️
@sakshamvashishtha4859
@sakshamvashishtha4859 2 ай бұрын
why we declared n as global ?
@Krishna-mz2uk
@Krishna-mz2uk Жыл бұрын
We started index from 0 na So why we are using indx+1
@codestorywithMIK
@codestorywithMIK Жыл бұрын
In C++ substr(idx, length) It includes the current element at idx too. For example : s = “abc” idx = 1 I want to take length of 2 substring s.substr(idx, 2) It will take “bc” i.e. start at idx = 1 And from here take 2 length i.e. “bc” so , idx+2 = 1+2
@twi4458
@twi4458 Жыл бұрын
@@codestorywithMIK Thanks for clearification bhaiya, I had the same doubt.
@manishv.8167
@manishv.8167 Жыл бұрын
Please don't pause the graph concept playlist and complete it soon, so that we can start with other concept like dp,tree ,etc
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Yep Coming tomorrow
@shriyanshjain4444
@shriyanshjain4444 Жыл бұрын
Need Help Can anyone tell me where am i wrong class Solution { public: bool isValid(string st){ if(st[0] == '0' || stoi(st) < 0 || stoi(st) > 255) return false; // leading 0 in 2 or 3 size parts AND range check return true; } void solve(string &s, int index, int &n, vector &answer, string ans, int parts){ if(index == n && parts == 4){ ans.pop_back(); // removing last dot . answer.push_back(ans); } if(index+1
@oqant0424
@oqant0424 Жыл бұрын
code fat jane ka matlab?
@codestorywithMIK
@codestorywithMIK Жыл бұрын
It means “error ajaega” Code fatna is like a slang used in corporate 😅
@oqant0424
@oqant0424 Жыл бұрын
@@codestorywithMIK ok😅
@yashgarg3027
@yashgarg3027 Жыл бұрын
please help it is showing illeagal character class Solution { public List restoreIpAddresses(String s) { List ans = new ArrayList(); if(s.length() > 12){ return ans; } int n = s.length(); String p = ""; helper(p,s,ans,0,0,n); return ans; } static void helper(String p,String s,List ans,int parts,int index,int n){ if(index == n && parts == 4){ ans.remove(ans.size()-1); ans.add(p); return; } if(index+1
@cacklouncle
@cacklouncle Жыл бұрын
My approach: Only 3 options are possible when we are at an index i of str 1. Only option is to take the char at index i. 2. Only option is to put a dot. 3. Exploring both above options class Solution: def f(self,i,n,temp,result,s,last,dotcount): if dotcount >3: return if i == n: if dotcount == 3: result.append(temp) return if last == "":#only_option_is_to_take_the_current_character self.f(i+1,n,temp+s[i],result,s,last+s[i],dotcount) elif last == '0' or int(last+s[i])>255: #only_option_is_to_put_a_dot self.f(i,n,temp+'.',result,s,"",dotcount+1) else:#exploring_both_options_(taking_current_char_and_putting_dot) self.f(i+1,n,temp+s[i],result,s,last+s[i],dotcount) self.f(i,n,temp+'.',result,s,"",dotcount+1) def restoreIpAddresses(self, s: str) -> List[str]: slen = len(s) result = [] if slen>12: return result self.f(0,slen,"",result,s,"",0) return result
Concatenated Words | Simple Story | META | Leetcode 472
23:17
codestorywithMIK
Рет қаралды 7 М.
Tailscale: NETWORKING MAGIC!
25:51
Level1Techs
Рет қаралды 43 М.
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 105 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,2 МЛН
Noodles Eating Challenge, So Magical! So Much Fun#Funnyfamily #Partygames #Funny
00:33
L1. Implement TRIE | INSERT | SEARCH | STARTSWITH
31:25
take U forward
Рет қаралды 324 М.
Restore IP Addresses - Leetcode 93 - Python
17:44
NeetCode
Рет қаралды 45 М.
AVL Trees & Rotations (Self-Balancing Binary Search Trees)
20:38
Back To Back SWE
Рет қаралды 350 М.
Advice from the Top 1% of Software Engineers
10:21
Kevin Naughton Jr.
Рет қаралды 3,4 МЛН
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 403 М.
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 105 МЛН