[LeetCode] Sum of Good Numbers

1 · · Feb. 16, 2025, 12:24 a.m.
Summary
3452. Sum of Good Numbers Given an array of integers nums and an integer k, an element nums[i] is considered good if it is strictly greater than the elements at indices i - k and i + k (if those indices exist). If neither of these indices exists, nums[i] is still considered good. Return the sum of all the good elements in the array. ...