020-004-003

Deque: Palindrome Checker

Hard

Problem Description

Deque: Palindrome Checker

In this problem, you will create a program that stores each character of a string into a Deque, then checks for a palindrome by repeatedly removing and comparing characters from both the front and back ends, and displays the result to standard output.

Learning Objective: Use Deque (double-ended queue) for accessing from both ends

Use Deque to check if a string is a palindrome.

Input

Line 1: String to check (lowercase letters only)

Output

If palindrome: [string] is a palindrome
If not: [string] is not a palindrome

Example

Input:

racecar
```java
Output:
```java
racecar is a palindrome

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up