+ 3

Challenge: Write a Code to find the number of words in an input string đŸ€”đŸ€”

Example string: "I got a long way to go And a long memory, I have been searching for an answer Always just out of reach, Blood on the floor Sirens repeat I have been searching for the courage To face my enemies, When they turn down the lights I hear my battle symphony, All the world in front of me If my armor breaks I will fuse it back, together battle symphony." This string has 70 words.. So, your output may be like this: Number of words in input string = 70 Code may be in any language you prefer.

5th Sep 2017, 7:45 AM
Sanjeev Kumar
Sanjeev Kumar - avatar
2 Answers
5th Sep 2017, 10:20 AM
Sanjeev Kumar
Sanjeev Kumar - avatar
+ 3
Also find the frequency of a particular word in the input string. Take input a particular word like "battle" and find how many times it has been repeated in the above string. Your output may be like this: Frequency of battle in input string = 2
5th Sep 2017, 7:50 AM
Sanjeev Kumar
Sanjeev Kumar - avatar