You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are given a string. The only operation allowed is to insert characters in the beginning of the string. How many minimum characters are needed to be inserted to make the string a palindrome string
Example:
Input: ABC
Output: 2
Input: AACECAAAA
Output: 2
Efficient Approach : Start checking the string each time if it is palindrome, and if not, then delete the last character
and check again. After deleting count number of characters from the last i.e., the characters to be added to front, there