2468. Valid Palindrome IV

Medium
Two Pointers
String

Description

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.

Statistics

Acceptance
75.6%
Submissions
26,849
Accepted
20,304