aboutsummaryrefslogtreecommitdiff
path: root/problem20.erl
blob: f393afb01420216b0ff580e535d300b0da6c5c06 (plain)
1
2
3
4
5
-module(problem20).
-export([solve/0]).

solve() -> lists:sum([X-48 || X <- integer_to_list(fact(100))]).
fact(1) -> 1; fact(X) -> X * fact(X-1).