You are viewing a single comment's thread. Return to all comments →
function miniMaxSum($arr) { sort($arr); $n = count($arr); $min = array_slice($arr, 0, $n - 1); $min_sum = array_sum($min); $max = array_slice($arr, 1); $max_sum = array_sum($max); echo $min_sum . ' '.$max_sum; }
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 →