Shohei Yoshida
Shohei Yoshida's Blog

Shohei Yoshida's Blog

LeetCode 1832. Check if the Sentence Is Pangram in F#

Shohei Yoshida's photo
Shohei Yoshida
·Oct 17, 2022·

1 min read

URL

leetcode.com/problems/check-if-the-sentence..

Code

github.com/syohex/dotnet-study/blob/master/..

let checkIfPangram (sentence: string) : bool =
    (sentence
     |> Seq.fold (fun acc c -> Set.add c acc) Set.empty
     |> Seq.toList
     |> List.length) = 26
 
Share this