Palindrome Check
Python
Easy
3 views
Problem Description
A string s (only letters and digits) is provided. Output YES if it is palindrome else NO.
Official Solution
import sys
s=sys.stdin.read().strip()
if not s: sys.exit(0)
sys.stdout.write('YES' if s==s[::-1] else 'NO')
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!