You are viewing a single comment's thread. Return to all comments →
I think this way is much more readable, even for people that are used to see functional programming codes!
arr.flatMap(e => List.fill(num)(e))
Seems like cookies are disabled on this browser, please enable them to open this website
List Replication
You are viewing a single comment's thread. Return to all comments →
I think this way is much more readable, even for people that are used to see functional programming codes!