Compare characters from both ends moving inward. If all match, it is a palindrome.
Problem Statement
Given a string, check if it is a palindrome.
Examples
Input: str = "madam"
Output: True
Explanation: Combining the input according to Check if String is Palindrome logic yields True.
Input: str = "hello"
Output: False
Explanation: Combining the input according to Check if String is Palindrome logic yields False.
Complexity
Time Complexity: O(n)
Space Complexity: O(1)