Cody

Problem 44512. Find if a given sentence is a palindrome

Solution 3375843

Submitted on 25 Oct 2020
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 = logical 1

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

ans = logical 1

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

ans = logical 1

Assertion failed.

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

ans = logical 1

Assertion failed.

Suggested Problems

Community Treasure Hunt

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

Start Hunting!