Evaluating Factorials

Published by er0s in

Create a function that takes an array of factorial expressions and returns their sum.

Examples

evalFactorial(["2!", "3!"]) ➞ 8

evalFactorial(["5!", "4!", "2!"]) ➞ 146

evalFactorial(["0!", "1!"]) ➞ 2

Notes

0! and 1! both equal 1.

Watch a quick demo on how Edabit works.