A string is a palindrome if and only if it reads the same forwards and backwards.
A substring of a string is a nonempty sequence of consecutive characters from .
Define a string to be odd if and only if all substrings of the string that are palindromes have odd length.
Given a string , determine if it is odd.
Constraints
will only contain lowercase ASCII letters.
Input Specification
The input consists of a single line containing the string .
Output Specification
Print on a single line, if the string is odd, Odd
; if not, Even
.
Sample Input 1
amanaplanacanalpanama
Sample Output 1
Odd
Sample Input 2
madamimadam
Sample Output 2
Odd
Sample Input 3
annamyfriend
Sample Output 3
Even
Sample Input 4
nopalindromes
Sample Output 4
Odd
Comments
just looked at the top solution and realized I am stupid.
for some reason you need to end your answers with a newline to pass? it does say
so idk
This happens to be a xiaowuc1 problem, which uses an
identical
checker. Standard convention uses a newline at the end of input, which is how the test data is formatted.To my younger students struggling with this question because you are attempting to check if every single substring is a palindrone, and then determining whether it has an even or odd length: I appreciate your tenacity.
There is a reason this is only a 3 point question and is considered "J2 level" as there is a simpler approach which may not be obvious to many of you. After fighting with this problem for a reasonable time, please click on the "Read editorial" link on the right, and read the message from the author for a hint.