finished your 60th video today. Came here to show my support. Please don't be disappointed as the view are declining. Once we finished the other videos, we will come here too. This is the only comprehensive DSA PlayList available on TH-cam. This is much much better than hundreds of paid courses.
Is it just me or with everyone that feels babbar bhaiya is exhausted but still recording the video Bhaiya please take proper rest and then start the course again. We need your full power !!!
Really Enjoyed this. However, one small check to be done for corner testcases: //insert all strings into Trie for (int i = 0; i < strs.size(); i++) { if(strs[i].empty()) // missing check to return in cases where the string is empty return ""; t->insertWord(strs[i]); }
❤💯 already solved trie construction in the morning today of leetcode both recursive and iterative approaches, both were right just by understanding the logic from you... so simple and easily understandable
bhaiya big fan 1 more approach :- sorting karke first and last string compare karenge to ans mil jayega string longestCommonPrefix(vector &arr, int n) { // Write your code here if(n==0)return ""; if(n==1)return arr[0]; sort(arr.begin(),arr.end()); string ans=""; string a=arr[0]; string b=arr[n-1]; for(int i=0;i
We can clearly see how much effort you are putting to provide us the quality content. recording the video half asleep🙂🙂🙂 dedication level is ++ GURU JI ++
maja aa rha hai .. previous day maine leet code , visual code , gfg se trise k question kara ,easy and loving this lecture for me...tq bhaiya for this...
wahh sirr another an exciting session ...wow.....but the second Trie mehtod approach giving TLE at submission time.... but first approach is optimal code solution for this problem...thanks sirrr...consistancy , respect , hardwork , dedication , passion ++++++
Just watched video review of your course by @desi coder . My comment there is "Best DSA course on YT🏅🏅🏅" Really Love bhai .. Thanks a lot for putting such an efforts... Don't worry about People getting impatient about the completion of this course. I know this will be completed. Iss level ka content wo b free me ... Hatts offff... Traits of an Army attitude🏅🏅🏅 Love, Abhishek Sharma Punjab
I am really really impressed with the way you teach. Thanks much. I have a question and I hope you wont mind revealing it. Actually I am really very curious to know that how long or how much time do you study in a day?
Maja aa gya bhaiya 😍😍😍 Finally aap ko catch kar liya course pe Ab aap ke sath daily daily wale video dekhi ga Aur ab hoga practice starting se #reached Lekin bhaiya code link update kar do 😁 Maja bahut aa raha Mera final sem chal raha lekin phir bhi continuous hu aap ke karan Kal mera paper hai 😂🤣😁🤣 You are best 😍😍😍
#Python:- x = ["flower", "flosing", "flowing"] prefix = "" for i in range(len(x[0])): flag = 0 temp = x[0][i] for j in range(1, len(x)): if not x[j][i] == temp: flag = 0 break else: flag = 1 if flag ==1: prefix+=temp else: pass print(prefix)
can someone please tell me how much syllabus of DSA is reamining and approximately how much videos will it take to complete,BTW execellent work bhaiya we can see all your efforts❤
hello bhaiya ik this is too late to ask but looks like you were unwell/sick while recording this lecture ,is it true? thanks for the efforts you put for us
My logic was: We can insert one string to the trie, then for rest of the strings we need to check the common prefix, but here must be a catch, [coding, code, codingninjas] -> here ans should be cod, so we need to store the min(ans, tempStr).
Hello Love Babbar sir, Thank you for sharing great knowledge. In this lecture you taught us one brute force solution with O(n*m) time complexity, I found one exception for shared solution, That code is not compatible with test case = [ "ab" , "a" ]. And I found quite better solution for that, which allows almost all test cases. If you allow me I want to contribute that updated code. Thank you.
hi sir i am from andrapradesh (AP)i dont know hindi well i am seeing your videos using subtitles but from past videos onwards subtitles are turned off..can you please turn on for nextvideo on wards
First I have completed all DSA series and now conclude this is Greatest ever DSA series to exists on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇♂ Thanks you.
finished your 60th video today. Came here to show my support. Please don't be disappointed as the view are declining. Once we finished the other videos, we will come here too. This is the only comprehensive DSA PlayList available on TH-cam. This is much much better than hundreds of paid courses.
Is it just me or with everyone that feels babbar bhaiya is exhausted but still recording the video
Bhaiya please take proper rest and then start the course again.
We need your full power !!!
Really Enjoyed this. However, one small check to be done for corner testcases:
//insert all strings into Trie
for (int i = 0; i < strs.size(); i++)
{
if(strs[i].empty()) // missing check to return in cases where the string is empty
return "";
t->insertWord(strs[i]);
}
❤💯 already solved trie construction in the morning today of leetcode both recursive and iterative approaches, both were right just by understanding the logic from you... so simple and easily understandable
Attandance ++
Consistency++
Thank you ++
bhaiya big fan
1 more approach :-
sorting karke first and last string compare karenge to ans mil jayega
string longestCommonPrefix(vector &arr, int n)
{
// Write your code here
if(n==0)return "";
if(n==1)return arr[0];
sort(arr.begin(),arr.end());
string ans="";
string a=arr[0];
string b=arr[n-1];
for(int i=0;i
Bhaiya, maza aarha h... Coding ab ho rhi h.. Leetcode ke questions bn rhe h..
Happy😁
Credit goes to you ☺
Bhai saab, JOB + Consistency == Faadu 🔥🔥🔥.
We can clearly see how much effort you are putting to provide us the quality content.
recording the video half asleep🙂🙂🙂 dedication level is ++
GURU JI ++
consistency vaps le aae ho bht ache bht ache
maja aa rha hai .. previous day maine leet code , visual code , gfg se trise k question kara ,easy and loving this lecture for me...tq bhaiya for this...
JAI SIYA RAM BHAI you are doing tremendous work
loving it
consistency++++++++
Your teaching is really Excellent,
very simple to understand
wahh sirr another an exciting session ...wow.....but the second Trie mehtod approach giving TLE at submission time.... but first approach is optimal code solution for this problem...thanks sirrr...consistancy , respect , hardwork , dedication , passion ++++++
yes it is giving TLE
yayy its showing tle
I am in recursion .... we all are with you
no one can beat u bhai in teaching and knowledge
Enjoyed a lot... Thanks for making such a quality content ❤️❤️
completed this lecture babbar ji still continuing to complete your whole data structure series !!!!!
aaag laga diya bhaiyaa
next level efforts
🔥🔥
Back to form..U have given enough upcoming students..❤️
Again out of form ig
Just watched video review of your course by @desi coder . My comment there is "Best DSA course on YT🏅🏅🏅"
Really Love bhai .. Thanks a lot for putting such an efforts... Don't worry about People getting impatient about the completion of this course. I know this will be completed.
Iss level ka content wo b free me ... Hatts offff... Traits of an Army attitude🏅🏅🏅
Love,
Abhishek Sharma
Punjab
I am from punjab as well..
Which district by the way?
@@bhawargujral3574 Hoshiarpur bro ... 🤝
Osm content ❤❤❤😊😊
int n=strs.size();
string ans="";
sort(strs.begin(),strs.end());
string s1=strs[0];
string s2=strs[n-1];
for(int i=0;i
Jaldi complete krrao bhaiya , mid March ka promise kiya tha apne , abb toh mid Aprila aaagya !!
This series is helping alot❤❤👍👍😊😊
Completed 80lectures!! 60 more to go!
Consistency 😍 thank you for the course👏
Thanks for this awesome series sir
Love you bhaiyya ❤️😘....thanks a lot for this.....please don't change bhaiyya.....love youuuuu
thank you bhaiya 😇😇🙏
Bhaiya lage raho..hum thoda video peeche hai...aap please Videos banate jao..hum saath me hai aapke ! 🔥
kk luv u bro good job MAKE Your FAMILY HAPPY AND SATISFIED WITH WHAT YOU DO
I am really really impressed with the way you teach. Thanks much. I have a question and I hope you wont mind revealing it. Actually I am really very curious to know that how long or how much time do you study in a day?
Maja aa gya bhaiya 😍😍😍
Finally aap ko catch kar liya course pe
Ab aap ke sath daily daily wale video dekhi ga
Aur ab hoga practice starting se
#reached
Lekin bhaiya code link update kar do 😁
Maja bahut aa raha
Mera final sem chal raha lekin phir bhi continuous hu aap ke karan
Kal mera paper hai 😂🤣😁🤣
You are best 😍😍😍
Krenge bhaiya ....aap ho toh mumkin hai
Thanks Bhai, these tutorials really helped me all these times.
Thank You So Much BHRATA SHREE !!!!!!!
Code here : leetcode.com/problems/longest-common-prefix/discuss/2659408/cpp-trie-love-babbar-approach
great explanation...thank you so much for making our path easy
#Python:-
x = ["flower", "flosing", "flowing"]
prefix = ""
for i in range(len(x[0])):
flag = 0
temp = x[0][i]
for j in range(1, len(x)):
if not x[j][i] == temp:
flag = 0
break
else:
flag = 1
if flag ==1:
prefix+=temp
else:
pass
print(prefix)
Thanks A lot BHaiya.......RESPECT++;
Bhaiya we are with you..
Easy and Smooth!!💯
thanks bhaiya crystal clear hai
Bhaiyaaa tussi great ho 💓💓
Having problem to solve more problem anyone suggest me where i can ask my doubt ,any whatsapp group or discard server
Is there any more optimzation in this like some people have used sorting
Sir amazing video
can someone please tell me how much syllabus of DSA is reamining and approximately how much videos will it take to complete,BTW execellent work bhaiya we can see all your efforts❤
Dont worry bro i think there will be little topics like - DP and graph mostly
Will this course continue
Thank you bhaiya😄consistency OP🥰
congratulations you have been selected amongst our shortlisted winners ✅
A direct message 👆
Make playlist for and Trie.
Present bhaiya ✋
congratulations you have been selected amongst our shortlisted winners ✅
A direct message 👆
Great explaination
Thanku for making great videos bhaiya
I trust you Babar thanks 👍
Thanks alot bhaiya.. consistency++
160 ✅completed 👍Liked 2:30
we can use linked list as well
Thank u bhaiya for your efforts
hello bhaiya ik this is too late to ask but looks like you were unwell/sick while recording this lecture ,is it true?
thanks for the efforts you put for us
Bhayya code submit karne ka samai time limit exceeded error aah raha hai. usko solve kaise kar raha tha??
is terminal helps edge cases like CODECHEF CODE we need as as 4 and not 7
My logic was: We can insert one string to the trie, then for rest of the strings we need to check the common prefix, but here must be a catch, [coding, code, codingninjas] -> here ans should be cod, so we need to store the min(ans, tempStr).
bhaiya.. what will be the Longest Common Prefix for ["flowering" , "flringow" , "flringight"]
ans..fl or ring?? please resolve this confusion!!
it should be ring , as it is "longest common"
The correct ans is fl
Reason is- question is about the longest common prefix and not longest common substring
@@hiddenmaster1724 why ring is not prefix ?
@@GrindMachine89 Prefix occurs at the beginning of root and not in between. "Ring" is a sub-part/sub-string.
@@hiddenmaster1724 flringow and flringight has ring in first part only
are mjja aa gya
9:09 // - Missing Case
Make sure that -> i >= arr[j].size() not i > arr[j].size()
if(i >= arr[j].size() || arr[j][i] != arr[0][i]){
check = false;
break;
}
// Complete Code
string longestCommonPrefix(vector &arr, int n)
{
int m = arr[0].size();
string ans = "";
for(int i = 0; i < m; i++){
bool check = true;
for(int j = 1; j < n; j++){
if(i >= arr[j].size() || arr[j][i] != arr[0][i]){
check = false;
break;
}
}
if(check) ans.push_back(arr[0][i]);
else break;
}
return ans;
}
Bhaiya os ki trh dbms Or cn ka series bhi start kariye please bhaiya humble request... 🙏🙏🙏
Attandance marked now solving stack questions Josh is high
Dsa course kb complete hoga...?
Pls tell@Love babbar total kitni video aaygi DSA course mein pls ek idea bta do🙏🙏🙏🙏🙏🙏
💯🙏Bhaiya lecture 17,18,19 .. etc ke handwritten notes bhi daliye plz🙏❤
thanx:)
Hello Love Babbar sir, Thank you for sharing great knowledge. In this lecture you taught us one brute force solution with O(n*m) time complexity, I found one exception for shared solution, That code is not compatible with test case = [ "ab" , "a" ]. And I found quite better solution for that, which allows almost all test cases. If you allow me I want to contribute that updated code. Thank you.
can you share your solution here?
Can I get loan zero interest to buy new laptop ...need it badly now ....
hi sir i am from andrapradesh (AP)i dont know hindi well i am seeing your videos using subtitles but from past videos onwards subtitles are turned off..can you please turn on for nextvideo on wards
Are bhaiya kya hua live course ka, kuch toh update dedo usk bare mein
Thanku Sir🙏
Thanks for your affort
bhaiya next video kab tak aaayegi?
Hope to greet you someday after getting placed
thank you bhaiya
Hanji 🎉
Bhaiya lecture 81 kab ayega
thx sir 🙏
why its not working in leetcode
If one of the input string is empty then it gives wrong answer
Mza aagya bhaiaya
congratulations you have been selected amongst our shortlisted winners ✅
A direct message 👆
Bhaiya moj kr diii
keep it up
Bhaiya iss video me timestamps dalna bhul gye
Lecture was amazing sir!
LEET CODE 14: LONGEST COMMON PREFIX (SOLUTION CODE)
class TrieNode {
public:
char data;
TrieNode* children[26];
bool isTerminal;
int childCount;
TrieNode(char ch){
data = ch;
for(int i=0;iisTerminal = true;
return;
}
int index = word[0] - 'a';
TrieNode* child;
if(root->children[index] != NULL){
child = root->children[index];
}
else{
child = new TrieNode(word[0]);
root->childCount++;
root->children[index] = child;
}
insertUtil(child, word.substr(1));
}
void insertWord(string word){
insertUtil(root,word);
}
void lcp(string str, string& ans){
for(int i=0;ichildCount == 1){
ans.push_back(ch);
int index = ch-'a';
root=root->children[index];
}
else
break;
if(root->isTerminal)
break;
}
}
};
class Solution {
public:
string longestCommonPrefix(vector& strs) {
Trie* t = new Trie();
for(auto i:strs){
if(i == "") return "";
t->insertWord(i);
}
string first = strs[0];
string ans = "";
t->lcp(first,ans);
return ans;
}
};
// ❤
Yes sir hum kar rahe hai abhi se
maja aa rha
Attendance done ,
maza agya
First I have completed all DSA series and now conclude this is Greatest ever DSA series to exists on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇♂ Thanks you.