#183. 统计指定长度字符串数量

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

统计指定长度字符串数量

Count Strings of Specific Length

Background

Congcong is currently learning about string processing. He encountered a task that requires finding strings of a specific length from a collection of strings.

Problem Description

Given an array of strings and an integer LL, return the count of strings in the array whose length is equal to LL.

Input Format

Input is given from standard input in the following format.

The first line contains an integer NN, representing the number of strings in the array. The second line contains NN strings, separated by spaces. The third line contains an integer LL, representing the target length.

Output Format

Output is printed to standard output in the following format.

An integer, representing the count of strings whose length is equal to LL.

Sample

4
a bb b ccc
1
2
4
a bb b ccc
2
1
4
a bb b ccc
4
0

Sample Explanation

In Sample 1, strings "a" and "b" have a length of 1, so the count is 2. In Sample 2, string "bb" has a length of 2, so the count is 1. In Sample 3, no string has a length of 4, so the count is 0.

Constraints

For all test cases: 1N1001 \le N \le 100 The length of each string is between 11 and 100100. 1L1001 \le L \le 100