Answers for "finding all palindromes in a string"

C
0

Palindrome String

Input: S = "abc" Output: 0Explanation: S is not a palindrome
Posted by: Guest on January-08-2022
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 "finding all palindromes in a string"

Code answers related to "C"

Browse Popular Code Answers by Language