calculating factorial using Java 8 IntStream?

前端 未结 4 1814
南笙
南笙 2021-01-15 12:00

I am relatively new in Java 8 and lambda expressions as well as Stream, i can calculate factorial using for loop or recursion. But is there a way t

4条回答
  •  一个人的身影
    2021-01-15 12:39

    I think we can change the main condition to: 1,vv-1,st with the function reduce. Maybe we can filter before we did the main rule

提交回复
热议问题