Answers for "checking palindrome sentence in c++ using stack"

C++
0

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;
	}

};
Posted by: Guest on March-22-2022

Code answers related to "checking palindrome sentence in c++ using stack"

Browse Popular Code Answers by Language