Search
⌘K
Get Premium
Leetcode 2757. Generate Circular Array Values
Given an integer array and an integer k, produce a new array where each element is the sum of k consecutive elements around the original array (k>0 sums the next k elements, k<0 sums the previous |k| elements, k=0 yields 0), with indices wrapping circularly; solve efficiently using sliding-window or prefix-sum techniques to handle wraparound.
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.