Check if a string is palindrome or not

Recursion DSA practice problem on Onlearn.

Difficulty: medium.

Topics: How to check if a string is a palindrome, Time Complexity, Space Complexity, Big O Notation, Loops, Conditional Statements, Recursion, Arrays, complexity analysis, string properties, string manipulation, recursion, two pointer technique, String Manipulation.

Palindrome String Problem Statement Given a string S, determine if it is a palindrome. A string is considered a palindrome if, after converting all uppercase letters into lowercase letters and removing all non alphanumeric characters, it reads the same forward and backward. Input Specification A single line containing a string S. Output Specification Print "Palindrome" if S is a palindrome, otherwise print "Not Palindrome". Sample Test Cases Example 1: Input: S = "ABCDCBA" Output: Palindrome Explanation: The string "ABCDCBA" is the same when reversed. Example 2: Input: S = "TAKE U FORWARD" Output: Not Palindrome Explanation: The string "TAKE U FORWARD" when reversed is "DRAWROF U EKAT", which is not the same as the original string. Example 3: Input: S = "A man, a plan, a canal: Panama" Output: Palindrome Explanation: After converting to lowercase and removing non alphanumeric characters, the string becomes "amanaplanacanalpanama", which is a palindrome.