


For the given string “what we think we become”
“what”,” think”, and “become” occurs 1 time, and “we” occurs 2 times in the given string.
The first and the only line of input contains a string S.
For each unique word in the given string, print the word along with its count of occurrence separated by a space in the new line.
You can print the output in any order.
0 <= |S| <= 10^5
Time Limit: 1sec
A better solution is to use a Map that stores a unique word as a key and count its occurrence in a given string as a value.