sliding window challenge, solution v3