bool isPalindrome(string str) {
          int left = 0;
          int right = str.size() - 1;
          while (left < right) {
              if (str[left++] != str[right--]) {
                  return false;
              }
          }
          return true;
      }
      
      Cpp language logo

      Palindrome String

      Check if the given string is palindrome or not

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.