Skip to content

Commit d6bca58

Browse files
author
YoussefKababe
committed
Add factorial solution in Elixir
1 parent bc53452 commit d6bca58

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

solutions/elixir/factorial.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
defmodule Factorial do
2+
def factorial(n), do: Enum.reduce(1..n, &(&1 * &2))
3+
end

0 commit comments

Comments
 (0)