Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Palindrome String solution in c++

class Solution{
public:	
	
	
	int isPalindrome(string S)
	{
	    // Your code goes here
        int n=S.length();
        for(int i=0;i<n/2;i++)
        {
            if(S[i]!=S[n-1-i])
            {
                return 0;
            }
        }
        return 1;
	}

};
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #Palindrome #String #solution
ADD COMMENT
Topic
Name
1+6 =