gregorbg
11/08/2019, 3:40 PMList<Int>
where every entry is a counter. What would be a Kotlin-esque way to map this into a List<Int>
where at every index the entry is equal to the sum of counts until that index? For example, [1, 3, 4, 2, 2]
becomes [1, 4, 8, 10, 12]
due to the following summations: [1, 1+3, 1+3+4, 1+3+4+2, 1+3+4+2+2]
Casey Brooks
11/08/2019, 3:48 PMgregorbg
11/08/2019, 7:35 PM