βConvert to Palindrome
Time Complexity: β
Space Complexity: β
The given solution on the website is wrong.
They are returning true after checking if no mismatch is found i.e. the given string is a valid palindrome.
But they are missing the fact that a valid palindrome cannot be converted to a valid palindrome by removing a single character if the palindrome is of even length.
Last updated