884. Uncommon Words from Two Sentences - LeetCode POTD - 17 September 2024

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024

ความคิดเห็น • 25

  • @harshsingh357
    @harshsingh357 วันที่ผ่านมา +2

    Thank you brother for such a nice explanation.
    The check that you have used in your code i.e
    if (val == ' ') {
    if (tmp != "") {
    um[tmp]++;
    tmp = "";
    }
    }
    It is used to push last word lets take an example :-
    For a string like "this apple is sweet", let's see how the code works:
    When the loop hits the space after "sweet", tmp = "sweet" and the word is added to the map.
    However, once the loop finishes, there’s no space after the last word "sweet". Without this check at the end, the last word wouldn’t be added to the map.
    By checking if (tmp != "") at the end, you ensure that "sweet" gets added to the map, ensuring no words are missed.
    Just wanted to say its a compulsory step of the code not an optional .
    I may be wrong so please clarify if I am .
    And Thank you again for explaining topics in depth :)

    • @Intuit_and_Code
      @Intuit_and_Code  วันที่ผ่านมา

      Yup You are correct.
      We can do this to remove its necessary-ness,
      string s = s1 + " " + s2 + " ";
      ~ThankYou for watching and expressing your view 💪🏻

  • @Helloitsme0907
    @Helloitsme0907 2 วันที่ผ่านมา +5

    Concatenate both strings -> traverse string and store value at indices till space occurs -> when space occurs store string in map and increase its count -> again start and repeat the process ->return the string with 1 count ❤ great explanation 🎉 thankyou 🙇

    • @Intuit_and_Code
      @Intuit_and_Code  2 วันที่ผ่านมา +1

      Yup, I think Someone got the explanation OwO 🌟

  • @whosdm1339
    @whosdm1339 2 วันที่ผ่านมา +2

    Nice bro great explanation
    Keep it up..❤

  • @Sam-gx9xl
    @Sam-gx9xl 2 วันที่ผ่านมา +2

    Baap level explanation Bhai ..Dil jeet liya apne

  • @udaychadhary09
    @udaychadhary09 2 วันที่ผ่านมา +1

    dammm teaching Broo
    You are the first one jiski video pa apna youtube ka phla comment kiya hai mena

    • @Intuit_and_Code
      @Intuit_and_Code  วันที่ผ่านมา

      😂 from now onwards you might have to comment on every videos of mine bcs i will make you comment 😈
      ~thanks ❤

  • @akashgupta1894
    @akashgupta1894 2 วันที่ผ่านมา +1

    keep it up bro good one

  • @ShivamUchiha
    @ShivamUchiha 2 วันที่ผ่านมา +1

    thanks baby, i was avoiding to learn hashmaps, but u taught me well

  • @Jonsnow556
    @Jonsnow556 2 วันที่ผ่านมา +1

    great solution

  • @JourneyWithMishra1
    @JourneyWithMishra1 วันที่ผ่านมา

    thanks brother

  • @surajgupta-mw1fp
    @surajgupta-mw1fp 2 วันที่ผ่านมา

    your explanation is very good

    • @Intuit_and_Code
      @Intuit_and_Code  2 วันที่ผ่านมา

      Glad You understand the concept ❤

  • @koby9340
    @koby9340 วันที่ผ่านมา +2

    could you do more videos in English please, thank you

    • @Intuit_and_Code
      @Intuit_and_Code  วันที่ผ่านมา +1

      English Requests are piling up,
      as i mentioned before I will be doing that after some time when my channel got enough stabilized and grow-ed
      I Hope you might eagerly wait for it ~Really love your support ❤

    • @koby9340
      @koby9340 วันที่ผ่านมา

      @@Intuit_and_Code good luck mate keep the hustle

  • @datfr1390
    @datfr1390 2 วันที่ผ่านมา

    bro I think u talk too fast, btw nice soltution 🔥 keep up the good works

    • @Intuit_and_Code
      @Intuit_and_Code  2 วันที่ผ่านมา +1

      Naa I did speed up the video by 1.3x while editing, because i thought u guys dont like my slow speed you can check before videos.
      From next time i go with 1.1x or 1.2x
      Anyways Thanks 💪🏻