sum-of-good-numbers
Code





# Code
```python3 []
class Solution:
    def sumOfGoodNumbers(self, nums: List[int], k: int) -> int:
        s=0
        for i in range(len(nums)):
            lc=(i-k>=0 and nums[i]>nums[i-k])
            rc=(i+k<len(nums) and nums[i]>nums[i+k])
            if (i-k<0 or lc) and (i+k>=len(nums)or rc):
                s+=nums[i]
        return s
```
['Python3']