let rec statistic_number = function | [] -> [] | x::xs -> let (splitg, splitd) = List.partition ~f:(fun y -> y = x) xs in (1 + List.length splitg, x) :: statistic_number splitd