my-solutions/codewars/ocaml/reduce-but-grow/main.ml

4 lines
96 B
OCaml

let rec grow (xs: int list): int =
match xs with
| [] -> 1
| x :: v -> x * (grow v);;