Problem 43325. Count given word x in text.

Solution 2071055

Submitted on 27 Dec 2019 by Asif Newaz
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!