You are viewing a single comment's thread. Return to all comments →
Hi
Your solution is good but it will take O(nlogn) time due to sorting which can be optimized to O(n) if input size n.
i hope below comment will help you in optimization.
https://www.hackerrank.com/challenges/mini-max-sum/forum/comments/587845
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
Hi
Your solution is good but it will take O(nlogn) time due to sorting which can be optimized to O(n) if input size n.
i hope below comment will help you in optimization.
https://www.hackerrank.com/challenges/mini-max-sum/forum/comments/587845