Ezvor

2330. Valid Palindrome IV

MediumTwo Pointers Preparing judge… LeetCode
Two PointersString

Hints

Hint 1
Count the number of pairs of characters that should be equal if s were a palindrome, but are not equal.
Hint 2
If the number of pairs is 0, then s is already palindrome. You can pick any pair of characters and change them both to a different character and s will stay a palindrome.