fork download
  1. let arr = [| [|1; 2; 4 |] ;[|3; 2; 4 |] ;[|1; 7; 4 |] |]
  2. arr |> Array.concat |> Array.sort |> Seq.groupBy id |> Seq.map(fun el -> fst el,Seq.length (snd el))
  3. |> Seq.iter(fun x -> printfn "%d [%d]" (fst x) (snd x))
Success #stdin #stdout 0.17s 26048KB
stdin
Standard input is empty
stdout
1 [2]
2 [2]
3 [1]
4 [3]
7 [1]