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.
Yes Rahul, it comes with practice. Solve questions on you own even though you write lengthy code and then check other's solutions. Thats how you will get ideas to solve efficiently.
This is called Machine Learning :P
Here is my code in Python2. I just sorted the list and printed the sum. First four elements would give least sum and last four elements would give max sum:
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
Yes Rahul, it comes with practice. Solve questions on you own even though you write lengthy code and then check other's solutions. Thats how you will get ideas to solve efficiently. This is called Machine Learning :P
Here is my code in Python2. I just sorted the list and printed the sum. First four elements would give least sum and last four elements would give max sum: