We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It's a problem of a moving window. You've got an array of n elements. You pick first d of them and calculate their max value. Then you move the window by 1 element to the right and calc max again. Out of all maxes you return a minimal value.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Queries with Fixed Length
You are viewing a single comment's thread. Return to all comments →
It's a problem of a moving window. You've got an array of n elements. You pick first d of them and calculate their max value. Then you move the window by 1 element to the right and calc max again. Out of all maxes you return a minimal value.