You are viewing a single comment's thread. Return to all comments →
$min = array_sum($arr); $max = 0; foreach($arr as $el){ $sum = array_sum($arr) - $el; $sum > $max ? $max = $sum : null; $sum < $min ? $min = $sum : null; } echo $min . " " . $max;
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 →