LeetCode 179. Largest Number in F#
URL
Code
let largestNumber (nums: int list) : string =
let v =
nums |> List.map string |> List.sortWith (fun a b -> compare (b + a) (a + b))
match v with
| [] -> failwith "never reach here"
| h :: _ when h = "0" -> "0"
| _ -> System.String.Concat v