Advertisement
2185. Counting Words With a Given Prefix
EasyView on LeetCode
2185.cs
C#
public class Solution
{
public int PrefixCount(string[] words, string pref)
{
return words.Count(w => w.StartsWith(pref));
}
}Advertisement
Was this solution helpful?