#183. 统计指定长度字符串数量
统计指定长度字符串数量
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 , return the count of strings in the array whose length is equal to .
Input Format
Input is given from standard input in the following format.
The first line contains an integer , representing the number of strings in the array. The second line contains strings, separated by spaces. The third line contains an integer , 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 .
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: The length of each string is between and .