Palindrome Checker

View as PDF

Submit solution


Points: 10 (partial)
Time limit: 1.0s
Memory limit: 32M

Author:
Problem type
Allowed languages
Python

Problem Statement

Given a list of intergers L, the task is to determine whether the list is a "Palindrome". A list is said to be a "Palindrome" if the elements in the list are the same when read from left to right as well as from right to left. In other words, if the list is reversed and the resulting list is the same as the original list, then the list is a "Palindrome". If the list is a "Palindrome", output "Yes", otherwise output "No".

Input Specification

The first line of the input gives the number of test cases, T, T test cases follow. Each test case consists of a line. The line contains the elements of the list which seperated by space.

Limits

Memory limits: 32MB.

Time limits: 1 second.

1 \leq T \leq 100

1\leq \text{length of L} \leq 10000

Test Set 1

Sample Case

Test Set 2

1\leq \text{length of L} \leq 100

Test Set 3

1\leq \text{length of L} \leq 1000

Test Set 4

1\leq \text{length of L} \leq 10000

Output Specification

For each test case, output one line containing Case #x: y, where x is the case number(starting from 1), and y is either "Yes" or "No" indicating whether the list is a "Palindrome" or not, respectively.

Sample Input

2
1 2 30 5 4 1
2 4 4 2

Sample Output

Case #1: No
Case #2: Yes

Hint

slice operator reversed


Comments

There are no comments at the moment.