Given an integer array nums and an integer k.
An element nums[i] is considered a good number if it satisfies the following conditions:
nums[i] > nums[i - k] whenever index i - k is within the bounds of the array.
nums[i] > nums[i + k] whenever index i + k is within the bounds of the array.
Return the sum of all good numbers in nums.
Constraints:
nums.length
nums[i]
k nums.length
Given an integer array nums and an integer k.
An element nums[i] is considered a good number if it satisfies the following conditions:
nums[i] > nums[i - k] whenever index i - k is within the bounds of the array.
nums[i] > nums[i + k] whenever index i + k is within the bounds of the array.
Return the sum of all good numbers in nums.
Constraints:
nums.length
nums[i]
k nums.length