Optimising a function that uses sum and map

后端 未结 0 433
盖世英雄少女心
盖世英雄少女心 2021-01-12 17:01

I have this function:

fn n | n < 5 = 1
fn n = sum (map fn [n-5..n-1])

But when I use a big value such as 900, it takes ages. How can I mak

相关标签:
回答
  • 消灭零回复
提交回复
热议问题