#K78752. One Modification Palindrome
One Modification Palindrome
One Modification Palindrome
Given a string s consisting only of lowercase letters, determine whether it is possible to transform s into a palindrome by modifying at most one character. A palindrome is a string that reads the same forwards and backwards. Formally, a string s of length n is a palindrome if \(s[i] = s[n-i-1]\) for \(0 \le i < n\). Even if the string is already a palindrome, it satisfies the condition. For example, the string "abca" can become a palindrome by changing one character, whereas "abcdef" would require more than one modification.
inputFormat
The input consists of a single line containing the string s.
Constraints: s contains only lowercase English letters. It may be empty.
outputFormat
Output a single line: True
if it is possible to form a palindrome by modifying at most one character, otherwise False
.
abca
True