def factorial n fac_times = ->(n, acc) { n == 0 ? acc : fac_times.(n - 1, acc * n) } fac_times.(n, 1) end