module Array = struct include Array (* @since 4.03.0 *) let mem x a = let n = length a in let rec loop i = if i = n then false else if compare (unsafe_get a i) x = 0 then true else loop (succ i) in loop 0 end let n = 5 let () = let a = Array.make 13 0 in for i = 0 to n - 1 do let x = Scanf.scanf "%d " (fun i -> i) in let x = x - 1 in a.(x) <- a.(x) + 1; done; let s = Array.mem 3 a in let t = Array.mem 2 a in let r = if s && t then "FULL HOUSE" else if s then "THREE CARD" else if not t then "NO HAND" else if Array.fold_left (fun m e -> m + if e = 2 then 1 else 0) 0 a = 2 then "TWO PAIR" else "ONE PAIR" in print_endline r