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.
this can be done in a single iteration i think you can find the sum while scanning the inputs and now run a loop from 0 to n-1 and substract an element from sum and update min and max variables after updating again add that element to sum....
if any wrong please reply
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
this can be done in a single iteration i think you can find the sum while scanning the inputs and now run a loop from 0 to n-1 and substract an element from sum and update min and max variables after updating again add that element to sum.... if any wrong please reply