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 :)
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 🙇
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 ❤
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 💪🏻
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 :)
Yup You are correct.
We can do this to remove its necessary-ness,
string s = s1 + " " + s2 + " ";
~ThankYou for watching and expressing your view 💪🏻
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 🙇
Yup, I think Someone got the explanation OwO 🌟
Nice bro great explanation
Keep it up..❤
Really Thanks bro 🍻
Baap level explanation Bhai ..Dil jeet liya apne
Dhanywad Bhai ko ❤️
dammm teaching Broo
You are the first one jiski video pa apna youtube ka phla comment kiya hai mena
😂 from now onwards you might have to comment on every videos of mine bcs i will make you comment 😈
~thanks ❤
keep it up bro good one
Thank you, I will
thanks baby, i was avoiding to learn hashmaps, but u taught me well
👶🏻thaank uu OwO
great solution
thanks bhai 😁
thanks brother
Welcome bro !!
your explanation is very good
Glad You understand the concept ❤
could you do more videos in English please, thank you
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 ❤
@@Intuit_and_Code good luck mate keep the hustle
bro I think u talk too fast, btw nice soltution 🔥 keep up the good works
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 💪🏻