You are viewing a single comment's thread. Return to all comments →
f# solution
open System let getCount key s = match Seq.tryFind (fun (k, _) -> k = key) s with | Some(_, values) -> Seq.length values | None -> 0 let _ = Console.ReadLine() let left = Console.ReadLine() |> (fun s -> s.Split(" ")) let _ = Console.ReadLine() let right = Console.ReadLine() |> (fun s -> s.Split(" ")) let groupLeft = left |> Seq.groupBy id let groupRight = right |> Seq.groupBy id Seq.append left right |> Seq.distinct |> Seq.filter (fun key -> (getCount key groupLeft) <> getCount key groupRight) |> List.ofSeq |> Seq.sort |> String.concat " " |> Console.WriteLine
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers (FP)
You are viewing a single comment's thread. Return to all comments →
f# solution