#23. 判断数组首元素是否为1

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

判断数组首元素是否为1

Array First Element Check

Background

Congcong is learning how to process arrays. He encountered a simple problem that requires checking a specific property of given arrays.

Problem Description

Start with two integer arrays, aa and bb, of any length. Return how many of the arrays have 11 as their first element.

Input Format

Input is given from standard input in the following format.

Two arrays, with elements of each array separated by spaces. Arrays can be empty.

Output Format

Output is printed to standard output in the following format.

An integer, representing the count of arrays whose first element is 11.

Sample

[1 2 3] [1 3]
2
[7 2 3] [1]
1
[1 2] []
1

Sample Explanation

Sample 1: The first array [1 2 3] has 11 as its first element, and the second array [1 3] also has 11 as its first element. Thus, there are 22 arrays whose first element is 11. Sample 2: The first array [7 2 3] does not have 11 as its first element, but the second array [1] has 11 as its first element. Thus, there is 11 array whose first element is 11. Sample 3: The first array [1 2] has 11 as its first element. The second array [] is an empty array and has no first element. Thus, there is 11 array whose first element is 11.

Constraints

Time limit: 11 second, Memory limit: 10241024 KiB for each test case.