• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
June 10, 2022 |4.6K Views

Convert the string into palindrome string by changing only one character

  Share   Like
Description
Discussion

Given a string str. Check if it is possible to convert the string into palindrome string by changing only one character.
Examples: 
 

Input : str = "abccaa"
Output : Yes
We can change the second last character
i.e. 'a' to 'b' to make it palindrome string

Input : str = "abbcca"
Output : No
We can not convert the string into palindrome
string by changing only one character.

Convert the string into palindrome string by changing only one character: https://www.geeksforgeeks.org/convert-string-palindrome-string-changing-one-character/