LeetCode 1980. Find Unique Binary String in F#
URL
Find Unique Binary String - LeetCode
Code
open System
let findDifferentBinaryString (nums: string list) : string =
let rec findDifferenceBinaryString' (nums: string list) i (acc: char list) =
match nums with
| [] -> acc |> List.rev |> String.Concat
| h :: t ->
if h.[i] = '0' then
findDifferenceBinaryString' t (i + 1) ('1' :: acc)
else
findDifferenceBinaryString' t (i + 1) ('0' :: acc)
findDifferenceBinaryString' nums 0 []