Cody

# Problem 43635. Return the amount of palindromes (words) in the string.

Solution 1995103

Submitted on 29 Oct 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   Fail
s='eye story pop dictionary noon enjoy software moon' assert(isequal(Palindromes(s),3))

s = 'eye story pop dictionary noon enjoy software moon' l = 1×8 cell array {'eye'} {'story'} {'pop'} {'dictionary'} {'noon'} {'enjoy'} {'software'} {'moon'}

Output argument "amount" (and maybe others) not assigned during call to "Palindromes". Error in Test1 (line 2) assert(isequal(Palindromes(s),3))

2   Fail
s='keep running' assert(isequal(Palindromes(s),0))

s = 'keep running' l = 1×2 cell array {'keep'} {'running'}

Output argument "amount" (and maybe others) not assigned during call to "Palindromes". Error in Test2 (line 2) assert(isequal(Palindromes(s),0))

3   Fail
s='the two men stood face to face' assert(isequal(Palindromes(s),0))

s = 'the two men stood face to face' l = 1×7 cell array {'the'} {'two'} {'men'} {'stood'} {'face'} {'to'} {'face'}

Output argument "amount" (and maybe others) not assigned during call to "Palindromes". Error in Test3 (line 2) assert(isequal(Palindromes(s),0))

4   Fail
s='Did he do that?' assert(isequal(Palindromes(s),1))

s = 'Did he do that?' l = 1×4 cell array {'Did'} {'he'} {'do'} {'that'}

Output argument "amount" (and maybe others) not assigned during call to "Palindromes". Error in Test4 (line 2) assert(isequal(Palindromes(s),1))

5   Fail
s='The civic duty of Anna was to level the kayak attached to the racecar at noon, so said her mom.' assert(isequal(Palindromes(s),7))

s = 'The civic duty of Anna was to level the kayak attached to the racecar at noon, so said her mom.' l = 1×20 cell array Columns 1 through 15 {'The'} {'civic'} {'duty'} {'of'} {'Anna'} {'was'} {'to'} {'level'} {'the'} {'kayak'} {'attached'} {'to'} {'the'} {'racecar'} {'at'} Columns 16 through 20 {'noon'} {'so'} {'said'} {'her'} {'mom'}

Output argument "amount" (and maybe others) not assigned during call to "Palindromes". Error in Test5 (line 2) assert(isequal(Palindromes(s),7))

6   Fail
s='Did she or did bob or did mom wow Anna at noon?' assert(isequal(Palindromes(s),8))

s = 'Did she or did bob or did mom wow Anna at noon?' l = 1×12 cell array {'Did'} {'she'} {'or'} {'did'} {'bob'} {'or'} {'did'} {'mom'} {'wow'} {'Anna'} {'at'} {'noon'}

Output argument "amount" (and maybe others) not assigned during call to "Palindromes". Error in Test6 (line 2) assert(isequal(Palindromes(s),8))

7   Fail
s='The rotor rotated on the level table.' assert(isequal(Palindromes(s),2))

s = 'The rotor rotated on the level table.' l = 1×7 cell array {'The'} {'rotor'} {'rotated'} {'on'} {'the'} {'level'} {'table'}

Output argument "amount" (and maybe others) not assigned during call to "Palindromes". Error in Test7 (line 2) assert(isequal(Palindromes(s),2))