#85. 数组7模式查找

    ID: 85 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatArray-2gesp1循环结构条件结构

数组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 {7,1,7}\{7, 1, 7\}.

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 true if the pattern is found; otherwise, output false.

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: 11 second, Memory limit: 10241024 KiB for each test case.