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

5 lines
96 B
OCaml
Raw Permalink Normal View History

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