``` fun maxSubarraySum(list: List<Int>, n: I...
# announcements
d
Copy code
fun maxSubarraySum(list: List<Int>, n: Int): Int? {
    if (list.isEmpty()) return null
    return (0..list.size - n).map { i -> list.subList(i, i + n).sum() }.max()
}
👍 3
i
Thanks for help - this is really concise and nice.