Solve the factorial fun problem using a non recursive solution.