Cody

# Problem 44358. I Plead the Fifth

Solution 2283369

Submitted on 15 May 2020 by Aron Frei
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
question = 'Are you the fifth child?'; assert(isempty(I_plead_the_fifth(question)))

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 0×0 empty char array

2   Pass
question = 'Were you at home on the night of 24 Oct 1974?'; assert(strcmpi(I_plead_the_fifth(question),'yes') || ... strcmpi(I_plead_the_fifth(question),'no'))

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no' pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no'

3   Pass
question = 'Did you go to work on 15 Oct 1955?'; assert(isempty(I_plead_the_fifth(question)))

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 0×0 empty char array

4   Pass
question = 'Did you go to the bowling alley last week?'; assert(strcmpi(I_plead_the_fifth(question),'yes') || ... strcmpi(I_plead_the_fifth(question),'no'))

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no' pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no'

5   Pass

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no' pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no'

6   Pass

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 0×0 empty char array

7   Pass

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no' pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 'no'

8   Pass
question = 'Do you have fifteen siblings?'; assert(isempty(I_plead_the_fifth(question)))

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 0×0 empty char array

9   Pass
question = 'Do two quarters equal fifty cents?'; assert(isempty(I_plead_the_fifth(question)))

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 0×0 empty char array

10   Pass
question = 'Do you own five dogs?'; assert(isempty(I_plead_the_fifth(question)))

pattern = 1×5 string array "5" "fifth" "fifty" "fifteen" "five" answer = 0×0 empty char array

11   Pass