1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
object Main { def process(items: List[Int]): Int = { var total = 0 for (v <- items) { if (v > 0) { total += v } else { total -= v } } total } val config = Map( "a" -> 1, "b" -> 2, ) }