Answers for "a palindrome . program"

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
-1

what is palindrome

function Palindrome(str) { 

  str = str.replace(/ /g,"").toLowerCase();
  var compareStr = str.split("").reverse().join("");

  if (compareStr === str) {
    return true;
  } 
  else {
    return false;
  } 

}
Posted by: Guest on June-17-2021

Code answers related to "a palindrome . program"

Browse Popular Code Answers by Language