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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Before reverse
"()()"
After reverse
")()("
Result not palindrome
Before reverse
"())("
After reverse
"())("
Result palindrome
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.