Ericsson Interview Question

A coding question about sliding window,