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.
The time limit forced me to take into consideration when the max value left the sliding window and only look for the new max whenever it was popped AND whenever the incoming value was not >= to that max (otherwise the new value would just replace the popped old max).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Deque-STL
You are viewing a single comment's thread. Return to all comments →
The time limit forced me to take into consideration when the max value left the sliding window and only look for the new max whenever it was popped AND whenever the incoming value was not >= to that max (otherwise the new value would just replace the popped old max).