Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2090. K Radius Subarray Averages
For each index i, compute the integer average of the subarray nums[i-k..i+k] (window size 2k+1) or -1 if the window goes out of bounds. The challenge is to produce the avgs array efficiently (n up to 1e5), typically via prefix sums or a sliding window to get O(n) time.
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.