SHARE
TWEET

Untitled

a guest Oct 13th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int isPalindrome(char *str, int len)
  2. {
  3.     int i = 0, j = len -1;
  4.     while (i <= j)
  5.     {
  6.         if (str[i] == ' ')
  7.         {
  8.             i++;
  9.             continue;
  10.         }
  11.  
  12.         if (str[j] == ' ')
  13.         {
  14.             j--;
  15.             continue;
  16.         }
  17.  
  18.         if (str[i] != str[j]) return 0;
  19.         i++;
  20.         j--;
  21.     }
  22.  
  23.     return 1;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top