#74. 检查数组是否包含特定元素

    ID: 74 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatArray-2gesp3一维数组循环结构

检查数组是否包含特定元素

No Ones and Threes

Background

Congcong is learning how to check for specific elements in an array.

Problem Description

Given an array of integers, return true if the array contains no 11's and no 33's. Otherwise, return false.

Input Format

Input is given from standard input in the following format.

An array of integers, with elements separated by spaces. For example: [0 2 4]

Output Format

Output is printed to standard output in the following format.

Output true if the array contains no 11's and no 33's; otherwise, output false.

Sample

[0 2 4]
true
[1 2 3]
false
[1 2 4]
false

Sample Explanation

Sample 1: The array [0 2 4] contains neither 11 nor 33, so it returns true. Sample 2: The array [1 2 3] contains 11 and 33, so it returns false. Sample 3: The array [1 2 4] contains 11, so it returns false.

Constraints

Time limit: 1 second Memory limit: 1024KB