Answers for "total palindromes possible using digits of a string"

C++
1

minimum characters to make string palindrome

string s;
    int len=0,i=1;
    cin>>s;
    int n=s.size();
    vector<int> LPS(n);
    LPS[0]=0;
    while(i<n)
    {
        if(s[i]==s[len]) LPS[i++]=++len;
        else
        {
            if(len==0) LPS[i++]=0;
            else len=LPS[len-1];
        }
    }
Posted by: Guest on December-21-2021
0

Palindrome String

Input: S = "abc" Output: 0Explanation: S is not a palindrome
Posted by: Guest on January-08-2022

Code answers related to "total palindromes possible using digits of a string"

Browse Popular Code Answers by Language