#74. 检查数组是否包含特定元素
检查数组是否包含特定元素
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 's and no '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
trueif the array contains no 's and no 's; otherwise, outputfalse.
Sample
[0 2 4]
true
[1 2 3]
false
[1 2 4]
false
Sample Explanation
Sample 1: The array [0 2 4] contains neither nor , so it returns true.
Sample 2: The array [1 2 3] contains and , so it returns false.
Sample 3: The array [1 2 4] contains , so it returns false.
Constraints
Time limit: 1 second Memory limit: 1024KB