PROBLEM LINK : leetcode.com/problems/restore... SOLUTION LINK : github.com/niveditaprity/Leet...
Жүктеу.....
Пікірлер: 15
@priyanshumauryakrishna2146 Жыл бұрын
👍
@soubhikghosh6564 Жыл бұрын
A nice question on Recursion!
@ayushverma3261 Жыл бұрын
Well Explained Nivedita..
@techadorabynivedita
Жыл бұрын
Thank you :) must share with your friends
@158_mdparwezzafar6 Жыл бұрын
excellent explanation like striver. 👌👌
@techadorabynivedita
Жыл бұрын
Thank you 😄
@harshk3351 Жыл бұрын
Ma'am In starting of solve we can add below condition as well correct: here I am trying to remove extra calls if((s.length() - i) > (4 - part) * 3 || (s.length() - i) return; }
@yashchamoli8695 Жыл бұрын
didi you are superb aap bahut aacha aur to the point padate ho thankyou didii i just need your aashirwad for better future please diiiiiiiiidiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 🙏🙏🙏🙏🙏🙏🙏🙏🙏
@techadorabynivedita
Жыл бұрын
Welcome :) , learning pe focus kro future fir to bright hi bright hai
@yashchamoli8695
Жыл бұрын
@@techadorabynivedita 🙏
@mrinalmadhav8119 Жыл бұрын
Nice explain
@techadorabynivedita
Жыл бұрын
Thank you :) must share with your friends
@ignite_your_power Жыл бұрын
Thankyou
@techadorabynivedita
Жыл бұрын
Welcome :)
@ManojKrVerma-vw4dx Жыл бұрын
bool is_valid_octet(string s) { int n = s.length(); if (n > 1 && s[0] == '0') { return false; } int num = stoi(s); if (num >= 0 and num 3 ) return; if (sz == 3) { temp.push_back(s.substr(idx)); string str = ""; for(string sr: temp){ if (is_valid_octet(sr) == false){ temp.pop_back(); return; } str += sr; str += "."; } temp.pop_back(); str.pop_back(); ans.push_back(str); return; } for(int i = idx + 1, len = 1; i temp.push_back(s.substr(idx, len)); helper(s, ans, temp, temp.size() , i); temp.pop_back(); } } vector restoreIpAddresses(string s) { int n = s.length(); if (n return {}; vector ans; vector temp; helper(s, ans, temp, 0, 0); return ans; } }; Why am I getting stoi error ? anyone please help
Пікірлер: 15
👍
A nice question on Recursion!
Well Explained Nivedita..
@techadorabynivedita
Жыл бұрын
Thank you :) must share with your friends
excellent explanation like striver. 👌👌
@techadorabynivedita
Жыл бұрын
Thank you 😄
Ma'am In starting of solve we can add below condition as well correct: here I am trying to remove extra calls if((s.length() - i) > (4 - part) * 3 || (s.length() - i) return; }
didi you are superb aap bahut aacha aur to the point padate ho thankyou didii i just need your aashirwad for better future please diiiiiiiiidiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 🙏🙏🙏🙏🙏🙏🙏🙏🙏
@techadorabynivedita
Жыл бұрын
Welcome :) , learning pe focus kro future fir to bright hi bright hai
@yashchamoli8695
Жыл бұрын
@@techadorabynivedita 🙏
Nice explain
@techadorabynivedita
Жыл бұрын
Thank you :) must share with your friends
Thankyou
@techadorabynivedita
Жыл бұрын
Welcome :)
bool is_valid_octet(string s) { int n = s.length(); if (n > 1 && s[0] == '0') { return false; } int num = stoi(s); if (num >= 0 and num 3 ) return; if (sz == 3) { temp.push_back(s.substr(idx)); string str = ""; for(string sr: temp){ if (is_valid_octet(sr) == false){ temp.pop_back(); return; } str += sr; str += "."; } temp.pop_back(); str.pop_back(); ans.push_back(str); return; } for(int i = idx + 1, len = 1; i temp.push_back(s.substr(idx, len)); helper(s, ans, temp, temp.size() , i); temp.pop_back(); } } vector restoreIpAddresses(string s) { int n = s.length(); if (n return {}; vector ans; vector temp; helper(s, ans, temp, 0, 0); return ans; } }; Why am I getting stoi error ? anyone please help