You are given a list of Strings allStringsList
and a String target
.
Find the number of times an exact match for target
is found in allStringsList
, return this value.
Example 1:
Input: allStringsList = ['Apple', 'Orange', 'Pear', 'Apple'], target='Apple`
Output: 2
Explanation: 'Apple' is found twice. In the first and last index of the list.
Example 2:
Input: allStringsList = ['Car', 'Bus', 'Train'], target='Bus'
Output: 1
Explanation: 'Bus' is found once
Example 3:
Input: allStringsList = ['Chair', 'Table', 'Pen'], target='Paper'
Output: 0
Explanation: 'Paper' is not in the list
Constraints
n == allStrings.size()
1 <= n < 10