DEV Community

Discussion on: Meme Monday

Collapse
 
musfick profile image
Musfick Jamil

Before reverse
"()()"
After reverse
")()("
Result not palindrome

Before reverse
"())("
After reverse
"())("
Result palindrome

Thread Thread
 
thumbone profile image
Bernd Wechner • Edited

You trumped us there with a brilliant demonstration. Avoiding the trap some of us fell into of confusing palindrome with symmetric (same in a mirror). Some strings are both of course, like "MAAM" but not palindromes like "POP" which are not mirror symmetric at all and strings like "dib" which are mirror symmetric but not a palindrome!

So, kudos for your insight and clever demonstration.