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.
If you use built in Python sort(), big O time complexity is already (n log n). If you then find sum(), it's (n) complexity. So it gives (n log n + n) and after simplifying (n log n).
If you use sum(), max(), min() is's (n+n+n) = (3n) and after simplifying (n).
Here is an example of one loop solution with time complexity (n)
(but it does really matter only for an astronomical length of an input)
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →