Cody

Problem 1712. NO _________ ALLOWED....

Solution 2214436

Submitted on 16 Apr 2020 by deandre vodka
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
Sentence = 'The birds in the field are eating bird seed'; Not_allowed = 'field' output = 1; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'field' s = 'The birds in the field are eating bird seed' exp = 'field' f = 1×1 cell array {'field'} output = 1

2   Pass
Sentence = 'If the sky is blue on earth, what is the sky color on mars?'; Not_allowed = 'oven' output = 0; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'oven' s = 'If the sky is blue on earth, what is the sky color on mars?' exp = 'oven' f = 0×0 empty cell array output = 0

3   Pass
Sentence = 'Oh where, oh where has my little dog gone?'; Not_allowed = 'where' output = 1; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'where' s = 'Oh where, oh where has my little dog gone?' exp = 'where' f = 1×2 cell array {'where'} {'where'} output = 1

4   Pass
Sentence = 'Insanity: doing the same thing over and over again and expecting different results...'; Not_allowed = 'Einstein' output = 0; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'Einstein' s = 'Insanity: doing the same thing over and over again and expecting different results...' exp = 'Einstein' f = 0×0 empty cell array output = 0

5   Pass
Sentence = 'Wheres the cream filling?'; Not_allowed = 'cream' output = 1; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'cream' s = 'Wheres the cream filling?' exp = 'cream' f = 1×1 cell array {'cream'} output = 1

6   Pass
Sentence = 'MATLAB is the coolest!'; Not_allowed = 'MATLAB' output = 1; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'MATLAB' s = 'MATLAB is the coolest!' exp = 'MATLAB' f = 1×1 cell array {'MATLAB'} output = 1

7   Pass
Sentence = 'No no, you got it all wrong!'; Not_allowed = 'No' output = 1; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'No' s = 'No no, you got it all wrong!' exp = 'No' f = 1×1 cell array {'No'} output = 1

8   Pass
Sentence = 'This planet, with all its appalling immensity, is to electric currents virtually no more than a small metal ball.'; Not_allowed = 'Tesla' output = 0; assert(isequal(NotAllowed(Sentence, Not_allowed),output))

Not_allowed = 'Tesla' s = 'This planet, with all its appalling immensity, is to electric currents virtually no more than a small metal ball.' exp = 'Tesla' f = 0×0 empty cell array output = 0

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!