4 ms·
The two versions that you give do not return the same thing. the FP one returns a list, while the imperative one returns a number
by kangoo1707 9y ago
The two versions that you give do not return the same thing. the FP one returns a list, while the imperative one returns a number
- archgoon 9y agoYes, but that's another issue with the article. Modifying the first to return a list though is trivial, you declare an List at the beginning and then you append in the for loop.