def factorial(num)
(1..num).inject(:*)
end
3!
factorial 3 #=> 6
10!
factorial 10 #=> 3628800
15!
factorial 15 #=> 1307674368000
def factorial(num)
(1..num).inject(:*)
end
factorial 3 #=> 6
factorial 10 #=> 3628800
factorial 15 #=> 1307674368000