Lecture 80: Longest Common Prefix Problem || Tries || C++ Placement Series

Поділитися
Вставка
  • Опубліковано 16 лис 2024

КОМЕНТАРІ • 188

  • @md.ualiurrahmanrahat2400
    @md.ualiurrahmanrahat2400 2 роки тому +75

    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 UA-cam. This is much much better than hundreds of paid courses.

  • @vaidanshkukreja8970
    @vaidanshkukreja8970 2 роки тому +147

    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 !!!

  • @Code0x64
    @Code0x64 Рік тому +7

    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]);
    }

  • @human75788
    @human75788 2 роки тому +32

    ❤💯 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

  • @gb9374
    @gb9374 2 роки тому +11

    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

  • @mr.himanshu4299
    @mr.himanshu4299 2 роки тому +2

    consistency vaps le aae ho bht ache bht ache

  • @inspiringzone12
    @inspiringzone12 2 роки тому +7

    Attandance ++
    Consistency++
    Thank you ++

  • @do_not_want_to_show
    @do_not_want_to_show 2 роки тому +3

    Bhai saab, JOB + Consistency == Faadu 🔥🔥🔥.

  • @aaryannaugaraiya1118
    @aaryannaugaraiya1118 2 роки тому +5

    Bhaiya, maza aarha h... Coding ab ho rhi h.. Leetcode ke questions bn rhe h..
    Happy😁
    Credit goes to you ☺

  • @MohammadAmmar-jr3sp
    @MohammadAmmar-jr3sp 2 місяці тому +1

    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 ++

  • @akashkumarmaurya2319
    @akashkumarmaurya2319 2 роки тому +2

    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...

  • @krishnaradhey2814
    @krishnaradhey2814 2 роки тому +4

    JAI SIYA RAM BHAI you are doing tremendous work

  • @NinjaCoders
    @NinjaCoders 2 роки тому +1

    Your teaching is really Excellent,
    very simple to understand

  • @varshadagar2140
    @varshadagar2140 2 роки тому +5

    loving it
    consistency++++++++

  • @shrutijaiswal871
    @shrutijaiswal871 2 роки тому +1

    Jaldi complete krrao bhaiya , mid March ka promise kiya tha apne , abb toh mid Aprila aaagya !!

  • @RavindraSingh-zg9eq
    @RavindraSingh-zg9eq 11 місяців тому

    no one can beat u bhai in teaching and knowledge

  • @CODEWK7
    @CODEWK7 2 роки тому +4

    I am in recursion .... we all are with you

  • @prashantbirajdar9271
    @prashantbirajdar9271 2 роки тому +5

    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 ++++++

  • @excelexpertclasses6776
    @excelexpertclasses6776 Рік тому

    completed this lecture babbar ji still continuing to complete your whole data structure series !!!!!

  • @amishapandey6875
    @amishapandey6875 Рік тому +2

    Completed 80lectures!! 60 more to go!

  • @Bad_Avadh
    @Bad_Avadh 2 роки тому +1

    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

  • @fazerugbrug439
    @fazerugbrug439 2 роки тому +2

    aaag laga diya bhaiyaa

  • @RajKumar-vq1nm
    @RajKumar-vq1nm 2 роки тому +2

    Back to form..U have given enough upcoming students..❤️

  • @vishalgarna4580
    @vishalgarna4580 Рік тому +1

    Osm content ❤❤❤😊😊

  • @RohitKumar-oo8lo
    @RohitKumar-oo8lo 2 роки тому +1

    Bhaiya lage raho..hum thoda video peeche hai...aap please Videos banate jao..hum saath me hai aapke ! 🔥

  • @ravivishvas3676
    @ravivishvas3676 2 роки тому +2

    next level efforts
    🔥🔥

  • @alokranjan3185
    @alokranjan3185 2 роки тому +3

    Thanks for this awesome series sir

  • @kunaljain1168
    @kunaljain1168 2 роки тому +2

    Make playlist for and Trie.

  • @utkarshsingh1457
    @utkarshsingh1457 2 роки тому +4

    Enjoyed a lot... Thanks for making such a quality content ❤️❤️

  • @kumarpawansahh
    @kumarpawansahh 2 роки тому

    Krenge bhaiya ....aap ho toh mumkin hai

  • @rachit_joshi
    @rachit_joshi 5 місяців тому

    Thank You So Much BHRATA SHREE !!!!!!!

  • @shantanu8880
    @shantanu8880 Рік тому

    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).

  • @Abhishek-ji6qj
    @Abhishek-ji6qj Рік тому

    #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)

  • @RavinderSingh-yo7dx
    @RavinderSingh-yo7dx 2 роки тому +2

    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?

  • @lokendrasingh9780
    @lokendrasingh9780 2 роки тому +1

    This series is helping alot❤❤👍👍😊😊

  • @yashasvic2429
    @yashasvic2429 Рік тому

    Thanks Bhai, these tutorials really helped me all these times.

  • @jericodcosta2049
    @jericodcosta2049 2 роки тому +1

    Attandance marked now solving stack questions Josh is high

  • @BhaiRayyanKiDuniya
    @BhaiRayyanKiDuniya 2 роки тому

    kk luv u bro good job MAKE Your FAMILY HAPPY AND SATISFIED WITH WHAT YOU DO

  • @BornHubisLive
    @BornHubisLive 2 роки тому +1

    Thanks A lot BHaiya.......RESPECT++;

  • @bhawargujral3574
    @bhawargujral3574 2 роки тому +2

    Consistency 😍 thank you for the course👏

  • @govindnair3135
    @govindnair3135 2 роки тому

    Love you bhaiyya ❤️😘....thanks a lot for this.....please don't change bhaiyya.....love youuuuu

  • @AnonymousCoder7
    @AnonymousCoder7 2 роки тому +6

    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

    • @bhawargujral3574
      @bhawargujral3574 2 роки тому

      I am from punjab as well..
      Which district by the way?

    • @AnonymousCoder7
      @AnonymousCoder7 2 роки тому +2

      @@bhawargujral3574 Hoshiarpur bro ... 🤝

  • @heybiplabb
    @heybiplabb 2 роки тому +1

    Present bhaiya ✋

    • @user-ic7mg6lz2k
      @user-ic7mg6lz2k 2 роки тому

      congratulations you have been selected amongst our shortlisted winners ✅
      A direct message 👆

  • @ayushgoyal8972
    @ayushgoyal8972 11 місяців тому

    we can use linked list as well

  • @BhaiRayyanKiDuniya
    @BhaiRayyanKiDuniya 2 роки тому

    Hope to greet you someday after getting placed

  • @ajvlogs1501
    @ajvlogs1501 2 роки тому +6

    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❤

    • @someshsangwan5302
      @someshsangwan5302 2 роки тому

      Dont worry bro i think there will be little topics like - DP and graph mostly

  • @focus.placement5589
    @focus.placement5589 2 роки тому

    thanks bhaiya crystal clear hai

  • @sukhpreetsingh5200
    @sukhpreetsingh5200 2 роки тому +1

    are mjja aa gya

  • @gitanjalikumari9262
    @gitanjalikumari9262 2 роки тому

    great explanation...thank you so much for making our path easy

  • @vashishthsharma4411
    @vashishthsharma4411 2 роки тому +1

    thank you bhaiya 😇😇🙏

  • @SahilKasekar-h5w
    @SahilKasekar-h5w Рік тому

    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.

  • @nishudwivedi3478
    @nishudwivedi3478 2 роки тому

    Bhaiya os ki trh dbms Or cn ka series bhi start kariye please bhaiya humble request... 🙏🙏🙏

  • @sukhjitsingh959
    @sukhjitsingh959 2 роки тому +1

    I trust you Babar thanks 👍

  • @teenageworrior1634
    @teenageworrior1634 2 роки тому +1

    💯🙏Bhaiya lecture 17,18,19 .. etc ke handwritten notes bhi daliye plz🙏❤

  • @jaydwarkadhish959
    @jaydwarkadhish959 2 роки тому +1

    Sir amazing video

  • @KratosProton
    @KratosProton 2 роки тому

    Great explaination

  • @codingindisguise
    @codingindisguise Рік тому

    Easy and Smooth!!💯

  • @satyanarayanareddy8817
    @satyanarayanareddy8817 2 роки тому +1

    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

  • @sanskrutishahu517
    @sanskrutishahu517 2 роки тому +1

    Video late aayegi chalega btt health comes first take proper rest and care bhaiya.

  • @laksheybanga8106
    @laksheybanga8106 2 роки тому

    Bhaiyaaa tussi great ho 💓💓

  • @TechUprise-by-Jyoti
    @TechUprise-by-Jyoti 2 роки тому

    Thank you bhaiya😄consistency OP🥰

    • @user-ic7mg6lz2k
      @user-ic7mg6lz2k 2 роки тому

      congratulations you have been selected amongst our shortlisted winners ✅
      A direct message 👆

  • @ArpitKumar-yo6up
    @ArpitKumar-yo6up 2 роки тому

    Thanku for making great videos bhaiya

  • @mihirvargante66
    @mihirvargante66 2 роки тому +2

    thanx:)

  • @shivkumar-og4ow
    @shivkumar-og4ow 2 роки тому

    Thanks alot bhaiya.. consistency++

  • @sumitrawat9526
    @sumitrawat9526 2 роки тому

    Bhaiya we are with you..

  • @jessicasinha9009
    @jessicasinha9009 2 роки тому

    Thank u bhaiya for your efforts

  • @AnkitRaj-pp6ph
    @AnkitRaj-pp6ph 2 роки тому +2

    Will this course continue

  • @iteself_me
    @iteself_me Рік тому

    160 ✅completed 👍Liked 2:30

  • @prathmeshghate6404
    @prathmeshghate6404 2 роки тому +1

    bhaya video dalo jaldi
    cover karliya hai saara

  • @tejashmaurya2149
    @tejashmaurya2149 Рік тому

    while(1)
    {
    love Babber;
    }

  • @lapade
    @lapade Рік тому

    Hanji 🎉

  • @muhammadsuleman8936
    @muhammadsuleman8936 Рік тому

    Lecture was amazing sir!

  • @prashantshukla6870
    @prashantshukla6870 2 роки тому

    Mza aagya bhaiaya

    • @user-ic7mg6lz2k
      @user-ic7mg6lz2k 2 роки тому

      congratulations you have been selected amongst our shortlisted winners ✅
      A direct message 👆

  • @BhaiRayyanKiDuniya
    @BhaiRayyanKiDuniya 2 роки тому

    keep it up

  • @govindsuryavanshi6653
    @govindsuryavanshi6653 Рік тому

    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.

  • @anuragpandey8165
    @anuragpandey8165 2 роки тому +3

    Bhai aur kitna late karoge yaarrr..... I am following this course from Lecture 1 and here I am after completing all the previous videos...... Please maintain some consistency..... at least 1 vid in 2 days.

    • @ashutosh61290
      @ashutosh61290 2 роки тому

      bro unka job bhi h, thoda unke bare me bhi socho.... waise hi clear dikh rha h ki wo kitne thke hue h.. phir bhi kr rhe h.

  • @deepakgarg2547
    @deepakgarg2547 2 роки тому +1

    Pls tell@Love babbar total kitni video aaygi DSA course mein pls ek idea bta do🙏🙏🙏🙏🙏🙏

  • @arpitrajput6424
    @arpitrajput6424 2 роки тому +3

    Having problem to solve more problem anyone suggest me where i can ask my doubt ,any whatsapp group or discard server

  • @jenishdabhi7480
    @jenishdabhi7480 2 роки тому +1

    hashmaps ke question karao

  • @kshitizmayank7208
    @kshitizmayank7208 10 місяців тому

    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

  • @BhaiRayyanKiDuniya
    @BhaiRayyanKiDuniya 2 роки тому

    maza agya

  • @studywithme66
    @studywithme66 2 роки тому

    Thanks for your affort

  • @abhisheksameer1842
    @abhisheksameer1842 2 роки тому

    maja aa rha

  • @063himanshumishra4
    @063himanshumishra4 2 роки тому

    Bhaiya moj kr diii

  • @nishankdeep3084
    @nishankdeep3084 2 роки тому

    thank you bhaiya

  • @iteself_me
    @iteself_me Рік тому

    kadak

  • @vivekjaiswal4391
    @vivekjaiswal4391 Рік тому

    Os is of bohot confusion hua isse

  • @subhrajeetbiswal6942
    @subhrajeetbiswal6942 2 роки тому

    It will be less than equal to

  • @ashish4k07
    @ashish4k07 11 місяців тому

    Is there any more optimzation in this like some people have used sorting

  • @studywithme66
    @studywithme66 2 роки тому

    Yes sir hum kar rahe hai abhi se

  • @smanivesh
    @smanivesh 2 роки тому +1

    bhaiya.. what will be the Longest Common Prefix for ["flowering" , "flringow" , "flringight"]
    ans..fl or ring?? please resolve this confusion!!

    • @GrindMachine89
      @GrindMachine89 2 роки тому

      it should be ring , as it is "longest common"

    • @hiddenmaster1724
      @hiddenmaster1724 2 роки тому +1

      The correct ans is fl
      Reason is- question is about the longest common prefix and not longest common substring

    • @GrindMachine89
      @GrindMachine89 2 роки тому

      @@hiddenmaster1724 why ring is not prefix ?

    • @hiddenmaster1724
      @hiddenmaster1724 2 роки тому

      @@GrindMachine89 Prefix occurs at the beginning of root and not in between. "Ring" is a sub-part/sub-string.

    • @GrindMachine89
      @GrindMachine89 2 роки тому

      @@hiddenmaster1724 flringow and flringight has ring in first part only

  • @NikhilSharma-qc1ez
    @NikhilSharma-qc1ez 2 роки тому +1

    Bhaiya lecture 81 kab ayega

  • @vishichaurasiya4427
    @vishichaurasiya4427 2 роки тому

    Mza++

  • @hardikjain-brb
    @hardikjain-brb 11 місяців тому

    is terminal helps edge cases like CODECHEF CODE we need as as 4 and not 7

  • @memorybyshubhammanitripath4368
    @memorybyshubhammanitripath4368 2 роки тому

    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 😍😍😍

  • @GuruPrasadShukla
    @GuruPrasadShukla 2 роки тому

    i'm making my attendance for today..

    • @user-ic7mg6lz2k
      @user-ic7mg6lz2k 2 роки тому +1

      congratulations you have been selected amongst our shortlisted winners ✅
      A direct message 👆

  • @vipulchaudhary_js
    @vipulchaudhary_js 2 роки тому +2

    Code here : leetcode.com/problems/longest-common-prefix/discuss/2659408/cpp-trie-love-babbar-approach

  • @akankshapandey8316
    @akankshapandey8316 2 роки тому

    Thanku Sir🙏

  • @shresthkaushik6636
    @shresthkaushik6636 Рік тому

    thx sir 🙏

  • @sukhjitsingh959
    @sukhjitsingh959 2 роки тому +1

    Can I get loan zero interest to buy new laptop ...need it badly now ....