Sherlock and MiniMax Discussions | Algorithms | HackerRank
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 don't get why this is considered a hard problem. Just sort the array, find the indices closest to p and q and then iterate through the elements between those indices and Bob is your uncle. The size of the array is so small you don't need to even consider optimization.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and MiniMax
You are viewing a single comment's thread. Return to all comments →
I don't get why this is considered a hard problem. Just sort the array, find the indices closest to p and q and then iterate through the elements between those indices and Bob is your uncle. The size of the array is so small you don't need to even consider optimization.