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.
I agree this wrong specification and poor example should be fixed. If it was a human interviewer we could ask for clarification on the boundary cases. Based on the title of the problem we might ASSUME it should be a fixed-length window over the entire set, and the equation is wrong. Others are very kind to answer the question but we can only hope those suggestions are from reverse-engineering the correct problem statement by submitting a passing solution.
Here is my understanding, after submitting a passing solution:
min(max(a[j])0<=i<=n-di<=j<i+d
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 →
I agree this wrong specification and poor example should be fixed. If it was a human interviewer we could ask for clarification on the boundary cases. Based on the title of the problem we might ASSUME it should be a fixed-length window over the entire set, and the equation is wrong. Others are very kind to answer the question but we can only hope those suggestions are from reverse-engineering the correct problem statement by submitting a passing solution. Here is my understanding, after submitting a passing solution: