This page is still under construction.

Parts of this page are still being built. What you see may change.

Palindrome Check

Interview

Time limit1sMemory limit256 MB

Summary
Check whether the given lowercase word reads the same forward and backward and print 1 or 0.
Level

Easy1 of 10

Topics
String, Two pointers
Solved
No attempts yet

Problem

알파벳 소문자로만 이루어진 단어가 주어진다. 이때, 이 단어가 팰린드롬인지 아닌지 확인하는 프로그램을 작성하시오.

팰린드롬이란 앞으로 읽을 때와 거꾸로 읽을 때 똑같은 단어를 말한다. 

level, noon은 팰린드롬이고, , online, judge는 팰린드롬이 아니다.

Input

첫째 줄에 단어가 주어진다. 단어의 길이는 1보다 크거나 같고, 100보다 작거나 같으며, 알파벳 소문자로만 이루어져 있다.

Output

첫째 줄에 팰린드롬이면 1, 아니면 0을 출력한다.

Examples4

  1. Example 1

    Input
    level
    
    Expected output
    1
    
  2. Example 2

    Input
    baekjoon
    
    Expected output
    0
    
  3. Example 3

    Input
    noon
    
    Expected output
    1
    
  4. Example 4

    Input
    abc
    
    Expected output
    0