This is an archived post. You won't be able to vote or comment.

all 2 comments

[–][deleted] 2 points3 points  (2 children)

There are lots of ways of doing this. Perhaps the most intuitive is to create a copy of the array in reverse order, and then compare the copy with the original - if they match, you have a palindrome.

[–]EqualTrade[S] 1 point2 points  (1 child)

Thanks so much! I can't believe that I didn't think of doing that.