3 ms·
ok, thanks, it looks to similar to haskell: factorial n=foldl1 (*) [1..n] that will throw an exception for n<1 because you will have an empty list
by hiena03 16y ago
ok, thanks, it looks to similar to haskell:
factorial n=foldl1 (*) [1..n]
that will throw an exception for n<1 because you will have an empty list