As far as I understand, the reduce function takes a list l and a function f. Then, it calls the function f on first two elements of th
l
f
Your function calls fact() on both arguments. You are calculating ((1! * 3!)! * 1!). The workaround is to only call it on only the second argument, and pass reduce() an initial value of 1.
fact()
((1! * 3!)! * 1!)
reduce()