You are viewing a single comment's thread. Return to all comments →
Your solution is O(n*log n) because of sorting. To make it O(n) just find minimum with linear search without sorting.
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
Your solution is O(n*log n) because of sorting. To make it O(n) just find minimum with linear search without sorting.