You are viewing a single comment's thread. Return to all comments →
Instead of to declare abs function, you can use Math.abs, and also the .toList is not necessary because the map function returns in this case a List
Here is my solution
even better with arr.map(math.abs)
How about arr.map(_.abs)?
I think this is a good solution.