Search
⌘K
Get Premium
Leetcode 3452. Sum of Good Numbers
Given an array nums and integer k, return the sum of all elements nums[i] that are strictly greater than the elements at indices i-k and i+k whenever those indices exist (edge comparisons only consider existing neighbors); if an element has neither neighbor, it is considered good.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.