Palindrome 1 - Check Palindrome


Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

Given a string \(S\), please determine whether or not \(S\) is a palindrome. A palindrome is a sequence of letters that is the same when read forwards or backwards.

Input Specification

The first and only line will contain a string \(S\) consisting of lowercase letters in the English alphabet. The length of \(S\) will not exceed \(10^{5}\) letters \((1 \le |S| \le 10^{5})\).

Output Specification

On a single line output YES if the string is a palindrome, and NO otherwise.

Sample Input 1

aaaba

Sample Output 1

NO

Sample Input 2

aaabaaa

Sample Output 2

YES

Comments


  • 0
    philosolog  commented on Jan. 25, 2024, 8:33 a.m.

    MLE with PyPy3... :(