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.
Shouldn't the spec be min[0<=i<N-d](max[i<=j<i+d](a[j]))? If i = N-1 is a valid value, as per the spec, then j can range up to N-1+d, which is out of bounds.
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 →
Shouldn't the spec be
min[0<=i<N-d](max[i<=j<i+d](a[j]))
? If i = N-1 is a valid value, as per the spec, then j can range up to N-1+d, which is out of bounds.