Cody

# Problem 44512. Find if a given sentence is a palindrome

Solution 1447491

Submitted on 23 Feb 2018 by David Verrelli
• Size: 19
• This is the leading solution.
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
x = "Nella's simple hymn: ""I attain my help, Miss Allen."; y_correct = true; assert(isequal(isPalindrome(x),y_correct))

ans = "NellassimplehymnIattainmyhelpMissAllen" ans = logical 1

2   Pass
x = "Deliver desserts,"" demanded Nemesis, ""emended, named, stressed, reviled."; y_correct = true; assert(isequal(isPalindrome(x),y_correct))

ans = "DeliverdessertsdemandedNemesisemendednamedstressedreviled" ans = logical 1

3   Pass
x = "Dennis danced"; y_correct = false; assert(isequal(isPalindrome(x),y_correct))

ans = "Dennisdanced" ans = logical 0

4   Pass
x = "Fred ate bread"; y_correct = false; assert(isequal(isPalindrome(x),y_correct))

ans = "Fredatebread" ans = logical 0

### Community Treasure Hunt

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

Start Hunting!