Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 4600b27

Browse files
committed
Merge pull request #166 from YoussefKababe/master
Add factorial solution in Elixir
2 parents bc53452 + d6bca58 commit 4600b27

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)