Recursive Palindrome

You are asked to write a program that determines whether a given string is a palindrome using recursion.
💡
A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward. This includes punctuation, capitalization, and spaces.
The first and only line of the input contains a string s of characters.
The program should print Yes if the string is a palindrome, or No if it's not.
Input
Output
madam
Yes
hello
No
Note: For simplicity, assume that input strings are provided in lowercase letters only, and the string does not contain any special characters or spaces.
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue