Tap here to switch tabs
Problem
Submissions

Problem: Valid Palindrome IV

Valid Palindrome IV asks whether a lowercase string can be changed into a palindrome using exactly one or two character replacements, returning true or false.

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

Valid Palindrome IV asks whether a lowercase string can be changed into a palindrome using exactly one or two character replacements, returning true or false.

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.