You are viewing a single comment's thread. Return to all comments →
F# Pipeline Solution
for T in 1..(stdin.ReadLine() |> int) do let K = stdin.ReadLine().Split()|>Array.map int |> fun a -> a.[1] stdin.ReadLine().Split() |> Array.countBy id |> Array.filter (fun (_,count) -> count >= K) |> function | [||] -> printfn "-1" | lst -> lst |> Array.map fst |> String.concat " " |> printfn "%s"
Seems like cookies are disabled on this browser, please enable them to open this website
Filter Elements
You are viewing a single comment's thread. Return to all comments →
F# Pipeline Solution