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.
Theoretically, you can use queue of length d. Add the next number, remove oldest one and calculate the minimum value of queue. It can be not the fastest algorithm, but with queue
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 →
Theoretically, you can use queue of length d. Add the next number, remove oldest one and calculate the minimum value of queue. It can be not the fastest algorithm, but with queue