Cody

Problem 2602. Did you say please? - Find one string within another without strfind or regexp/regexpi

Solution 1944750

Submitted on 21 Sep 2019
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
user_solution = fileread('please.m'); assert(isempty(strfind(user_solution,'strfind'))); assert(isempty(strfind(user_solution,'regexp'))); assert(isempty(strfind(user_solution,'regexpi')));

2   Fail
x = 'Can you do my homework for me?'; y_correct = '...'; assert(isequal(please(x),y_correct))

t1 = logical 0 t2 = 0 t3 = logical 0

Output argument "reply" (and maybe others) not assigned during call to "please". Error in Test2 (line 3) assert(isequal(please(x),y_correct))

3   Fail
x = 'Please, can you do my homework for me?'; y_correct = 'OK'; assert(isequal(please(x),y_correct))

t1 = logical 0 t2 = 1 t3 = logical 0

Output argument "reply" (and maybe others) not assigned during call to "please". Error in Test3 (line 3) assert(isequal(please(x),y_correct))

4   Fail
x = 'Come on Tuesday morning, please!'; y_correct = 'OK'; assert(isequal(please(x),y_correct))

t1 = logical 1 t2 = 0 t3 = logical 0

Output argument "reply" (and maybe others) not assigned during call to "please". Error in Test4 (line 3) assert(isequal(please(x),y_correct))

5   Fail
x = 'PLEASE, HELP ME!!!'; y_correct = 'OK'; assert(isequal(please(x),y_correct))

t1 = logical 0 t2 = 0 t3 = logical 1

Output argument "reply" (and maybe others) not assigned during call to "please". Error in Test5 (line 3) assert(isequal(please(x),y_correct))

6   Fail
x = 'Pleased to see you again, could you give me a hand?'; y_correct = '...'; assert(isequal(please(x),y_correct))

t1 = logical 0 t2 = 0 t3 = logical 0

Output argument "reply" (and maybe others) not assigned during call to "please". Error in Test6 (line 3) assert(isequal(please(x),y_correct))

7   Fail
x = 'Pleased to see you again, could you please give me a hand?'; y_correct = 'OK'; assert(isequal(please(x),y_correct))

t1 = logical 1 t2 = 0 t3 = logical 0

Output argument "reply" (and maybe others) not assigned during call to "please". Error in Test7 (line 3) assert(isequal(please(x),y_correct))