Hacker News new | ask | show | jobs
by Larrikin 654 days ago
Its a small example so the efficiency doesn't matter, but you could use sequences when it does https://kotlinlang.org/docs/sequences.html .

Also the map function lets you perform any operations in it. It was a simple example but you could need to perform something slightly more complex than using another standard library function.