IBM Interview Question

Slinding window based coding Hacker Rank question