Problem 43325. Count given word x in text.

Solution 1605334

Submitted on 10 Aug 2018 by Srishti Saha
  • Size: 12
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
text = 'When you finish the test, you will be told approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.'; x='you'; y_correct = 2; assert(isequal(Repeat(x,text),y_correct))

ans = 2

2   Pass
text = 'when you go you are active, when you run you are active, when you sleep you are lazy'; x='when'; y_correct = 3; assert(isequal(Repeat(x,text),y_correct))

ans = 3

Suggested Problems

More from this Author37

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!