#K73537. Palindrome List Checker
Palindrome List Checker
Palindrome List Checker
You are given a list of integers. Your task is to determine whether the list is a palindrome. A list is considered a palindrome if it reads the same backward as forward.
The list can be empty, in which case it is considered a palindrome. You need to output the exact string "The list is a palindrome." if the list is a palindrome, otherwise output "The list is not a palindrome."
Note: The input will be given via standard input (stdin) and the output must be printed to standard output (stdout).
inputFormat
The first line contains an integer n representing the number of elements in the list.
If n is greater than 0, the second line contains n space-separated integers. If n is 0, then the list is empty.
outputFormat
Print a single line containing the string:
- "The list is a palindrome." if the list is a palindrome, or
- "The list is not a palindrome." if it is not.
5
1 2 3 2 1
The list is a palindrome.