My solution to Sliding window challenge


#1

This is my solution to this callenge:

val valuesToAdd = listOf(1,18,73,3,44,6,1,33,2,22,5,7)
println(valuesToAdd.filter{ it >= 5 }.chunked(2).map{ it[0] * it[1]}.fold(0) { accumulator, number -> accumulator + number })

I hope this will be useful to somebody.

Cheers