Twice conditions - JS - O ( N ) - beats 100 %
```javascript []
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var sumOfGoodNumbers = function(nums, k) {
    let ans = 0

    for (let i = 0; i < nums.length; i++) {
        if ((nums[i-k] ?? 0) < nums[i])
            if ((nums[i+k] ?? 0) < nums[i])
                ans += nums[i]
    }
    
    return ans
};
```
['JavaScript']