LeetCode 520. Detect Capital in F#

URL

https://leetcode.com/problems/detect-capital/description/

Code

https://github.com/syohex/dotnet-study/blob/master/fsharp/leetcode/challenge/202301/detect_capital/main.fsx

open System

let detectCapitalUse (word: string) : bool =
    let cs = word |> Seq.toList

    if (cs |> List.head |> Char.IsLower) then
        cs |> List.forall Char.IsLower
    else
        cs |> List.forall Char.IsUpper
        || cs |> List.skip 1 |> List.forall Char.IsLower