#85. 数组7模式查找
数组7模式查找
Find 7's Pattern
Background
Congcong is playing a number game recently, and he needs to find specific number patterns in an integer array.
Problem Description
Given an array of integers, return true if the array contains two 7's next to each other, or there are two 7's separated by one element, such as with .
Input Format
Input is given from standard input in the following format.
An array of integers
nums.
Output Format
Output is printed to standard output in the following format.
Output
trueif the pattern is found; otherwise, outputfalse.
Sample
[1 7 7]
true
[1 7 1 7]
true
[1 7 1 1 7]
false
Sample Explanation
Sample 1: The array contains two 7's next to each other. Sample 2: The array contains two 7's separated by one element. Sample 3: The array does not contain two 7's next to each other, nor two 7's separated by one element.
Constraints
Time limit: second, Memory limit: KiB for each test case.