Problem 43325. Count given word x in text.

Solution 2021518

Submitted on 14 Nov 2019 by Meshal Alsharif
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))

s = 6 27 s = 2 y = 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))

s = 1 29 58 s = 3 y = 3