AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Code


# Code
```kotlin []
class Solution {
    fun sumOfGoodNumbers(nums: IntArray, k: Int): Int {
        var sum = 0
        for(i in nums.indices){
            val left = nums.getOrNull(i - k)
            val right = nums.getOrNull(i + k)
            if(left?: -1 < nums[i] && right?: -1 < nums[i]) sum += nums[i]
        }
        return sum
    }
}
```
['Kotlin']