Amazon interview question

window sum, find k nearest point