Super easy solution C#
Complexity
Time complexity: O(N)

Space complexity: O(1)
Code

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

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

# Code
```csharp []
public class Solution {
    public int SumOfGoodNumbers(int[] nums, int k) {
        int sum = 0;
        int n = nums.Length;
        for(int i = 0; i < n; i++)
        {
            bool good = true;
            if(i + k < n && nums[i] <= nums[i + k])
            {
                good = false;
            }
            if(i - k >= 0 && nums[i] <= nums[i - k])
            {
                good = false;
            }
            if(good)
            {
                sum += nums[i];
            }
        }
        return sum;
    }
}
```
![89f26eaf70fa927a79d4793441425859.jpg](https://assets.leetcode.com/users/images/baf543b1-8bef-4bef-ad9e-ebd3104f1057_1740919198.2357051.jpeg)

['Array', 'C#']