Tap here to switch tabs
Problem
Submissions

Problem: Counting Words With a Given Prefix

Try to solve the Counting Words With a Given Prefix problem.

Statement

Given an array of strings words and a string pref, return the number of strings in words that contain pref as a prefix.

Note: A prefix of a string is any leading contiguous substring of that string.

Constraints:

  • 1≤1 \leq words.length ≤100\leq 100

  • 1≤1 \leq words[i].length, pref.length ≤100\leq 100

  • words[i] and pref consist of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Counting Words With a Given Prefix

Try to solve the Counting Words With a Given Prefix problem.

Statement

Given an array of strings words and a string pref, return the number of strings in words that contain pref as a prefix.

Note: A prefix of a string is any leading contiguous substring of that string.

Constraints:

  • 1≤1 \leq words.length ≤100\leq 100

  • 1≤1 \leq words[i].length, pref.length ≤100\leq 100

  • words[i] and pref consist of lowercase English letters.