LeetCode 2185. Counting Words With a Given Prefix in F#

URL

Counting Words With a Given Prefix - LeetCode

Code

https://github.com/syohex/dotnet-study/tree/master/fsharp/leetcode/challenge/202501/counting_words_with_a_given_prefix/main.fsx

let prefixCount (words: string list) (pref: string) : int =
    words |> List.filter (fun (s: string) -> s.StartsWith(pref)) |> List.length