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 was wondering the same. This requires the array to be sorted, which obviously leads to the complexity of O(n log n). I wonder if we can solve it by using other data structures (thus increasing the space complexity)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Absolute Difference in an Array
You are viewing a single comment's thread. Return to all comments →
I was wondering the same. This requires the array to be sorted, which obviously leads to the complexity of O(n log n). I wonder if we can solve it by using other data structures (thus increasing the space complexity)