open System.Collections.Generic open System.Linq let getArgs = let args = System.Console.ReadLine().Split( ' ' ):string[] let dict = new Dictionary() for i in args do match (dict.ContainsKey i) with | false -> dict.Add( i , 1) | true -> dict.Item i <- (dict.Item i + 1) dict let Rank (dict:Dictionary) = let dictv = dict.Values.OrderByDescending(fun x -> x).ToArray() let TryItem x = match Array.tryItem x dictv with | None -> 1 | Some(x) -> x match ( (TryItem 0) , (TryItem 1)) with | 3, 2 -> printfn "FULL HOUSE" | 3, _ -> printfn "THREE CARD" | 2, 2 -> printfn "TWO PAIR" | 2, _ -> printfn "ONE PAIR" | _, _ -> printfn "NO HAND" Rank getArgs