Skip to content

Commit c1164a7

Browse files
committed
Merge pull request blakeembrey#166 from YoussefKababe/master
Add factorial solution in Elixir
2 parents c66fc97 + b4a3139 commit c1164a7

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)