#6. 检查数组首尾元素是否为6

    ID: 6 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatArray-1gesp3一维数组条件结构

检查数组首尾元素是否为6

Check Array First or Last Element

Background

Congcong is learning basic array operations. He encountered a problem that requires checking specific elements of an array.

Problem Description

Given an array of integers, return true if the number 66 appears as either the first or last element in the array. The array will be of length 11 or more.

Input Format

Input is given from standard input in the following format.

A single line containing an array of integers, with elements separated by spaces.

Output Format

Output is printed to standard output in the following format.

Output true if 66 appears at the beginning or end of the array; otherwise, output false.

Sample

1 2 6
true
6 1 2 3
true
13 6 1 2 3
false

Sample Explanation

Sample 11: The last element of the array is 66, so true is returned. Sample 22: The first element of the array is 66, so true is returned. Sample 33: The first element of the array is 1313, and the last element is 33. Neither is 66, so false is returned.

Constraints

Time limit: 11 second per test case. Memory limit: 10241024 KiB per test case.