Tap here to switch tabs
Problem
Submissions

Problem: Valid Palindrome IV

med
30 min
Try to solve the Valid Palindrome IV problem.

Statement

You are given a string s consisting only of lowercase English letters.

In a single operation, you can replace any character in s with any other lowercase English letter.

Return true if s can be turned into a palindrome by performing exactly 11 or 22 operations, or false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Valid Palindrome IV

med
30 min
Try to solve the Valid Palindrome IV problem.

Statement

You are given a string s consisting only of lowercase English letters.

In a single operation, you can replace any character in s with any other lowercase English letter.

Return true if s can be turned into a palindrome by performing exactly 11 or 22 operations, or false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists only of lowercase English letters.