0
Find the no of occurrence of a word from a given string not using collections??
ex:: this that i am that am this output:2 this 2 that 1 i 2 am anybody know the answer?? urgent plz
1 Answer
+ 1
I have forgotten the syntax but can give the algo.
1. store the string in s variable
2. 1st loop for getting each word using split by space. loop should run for half of the string length to avoid double counting
3. 2nd loop inside 1st to count the occurrences of the word. this loop