LeetCode 151. Reverse Words in a String in F#
URL
leetcode.com/problems/reverse-words-in-a-st..
Code
github.com/syohex/dotnet-study/blob/master/..
let reverseWords (s: string) : string =
s.Split [| ' ' |]
|> Seq.filter (System.String.IsNullOrEmpty >> not)
|> Seq.rev
|> Seq.toArray
|> String.concat " "