[Python3] Good enough
```python3 []
class Solution:
    def sumOfGoodNumbers(self, nums: List[int], k: int) -> int:
        return sum(nums[i] if (i<k or nums[i-k]<nums[i]) and (i>=len(nums)-k or nums[i+k]<nums[i]) else 0 for i in range(len(nums)))
```
['Python3']