LeetCode 2185. Counting Words With a Given Prefix in F#
URL
Counting Words With a Given Prefix - LeetCode
Code
let prefixCount (words: string list) (pref: string) : int =
words |> List.filter (fun (s: string) -> s.StartsWith(pref)) |> List.length