14. Longest Common Prefix || Java || Leetcode || Hindi

preview_player
Показать описание
Leetcode Link:

DSA through Java-Leetcode Questions Playlist:

TCS Coding Question and Solution Playlist:

Programs in C Language Playlist:

Programs in Java Playlist:

Join Telegram Group for Notes, Quiz, Placement opportunities and more:
Рекомендации по теме
Комментарии
Автор

//C++ code

string common(string s1, string s2)
{
int n=min(s1.length(), s2.length());
string ans;
for(int i=0;i<n;i++){
if(s1[i]==s2[i]){
ans.push_back(s1[i]);
}
else{
break;

}
}
return ans;
}
string LCP(string ar[], int n)
{
string res=ar[0];//single word ka case m fasne se bachne k liye
for(int i=1;i<n;i++)
{
res=common(res, ar[i]);
}

return res;
}

Mohit-fehx
Автор

bro you make everything easy
will let you know if there is any problem if we need

taheershaikh
Автор

what an explanation to the mark
Good work bro

aneeketvispute
Автор

wow, this is very easy to understand man . thanks, keep making more videos .

shaileshkumar
Автор

bahut accha trika h ye ekdam easy
nhi to dimag ka bheja fry ho gya tha.

manashvardhan
Автор

bhai apka explain krne ka tarika bht gajab
uhi video bnate rhe ap

SachinKumar-zdqh
Автор

Straight forward approach ❤
Thank you

naincypatel
Автор

superb approch and easy approch for this code

kapilraivines
Автор

Thank you soo much very well explained

mz_edits