Typeof
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```javascript []
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var sumOfGoodNumbers = function(nums, k) {
    let sum = 0;
    for (i=0; i<nums.length; i++) {
        if ((typeof nums[i+k] === 'undefined' || nums[i+k] < nums[i] ) && (typeof nums[i-k] === 'undefined' || nums[i-k] < nums[i] ) ) {            
                sum = sum + nums[i];            
        }   
    }
    return sum;
};
```
['JavaScript']