Meet Coco
Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix.
K Radius Subarray Averages
You're smoothing a noisy sensor log: for each reading, average it with the k readings on either side, rounded down, or answer -1 when one side runs out of neighbors. Interviewers love it because each window overlaps the next one almost entirely. The classic trap is overflow: a few readings near two billion already outgrow a 32-bit integer. You get 1 to 100,000 readings, each from 0 to 2,000,000,000, and k can be anything from 0 to 100,000.
Meet Coco
Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix.
Write it, run it, and explain it out loud. Sign in if you want this work on another device.
Email me this problem link
Code this one on a laptop
Email yourself a link and open it there.