P21775 [GeeksforGeeks] Palindrome string0817
普及-
题目描述

Given a string S, check if it is palindrome or not.
Example 1:
Input: S = "abba"
Output: 1
Explanation: S is a palindrome
Example 2:
Input: S = "abc"
Output: 0
Explanation: S is not a palindrome

Your Task:
You don't need to read input or print anything. Complete the function isPalindrome()which accepts string S and returns an integer value 1 or 0.
Expected Time Complexity: O(Length of S)
Expected Auxiliary Space: O(1)
Constraints:
1 <= Length of S<= 10^{5}

输入格式

见题面

输出格式

见题面

样例输入
S = "abba"
样例输出
1