Answers for "check if a string can be recostructed to a palindrome"

C++
0

Palindrome String

Input: S = "abba"Output: 1Explanation: S is a palindrome
int isPalindrome(string S)
	{
	    string st = S;
	    char temp;
	    int i=0, j= st.length()-1;
	    while(j>i)
	    {
	       if(S[i] != S[j])
	       {
	           return 0;
	       }
	       i++;
	       j--;
	    }
	    return 1;
	}
Posted by: Guest on January-08-2022

Code answers related to "check if a string can be recostructed to a palindrome"

Browse Popular Code Answers by Language