You are viewing a single comment's thread. Return to all comments →
PHP solutions
unimportant = 0; foreach (key => $value) {
if ($value[1] == 1) { `$importantContest[] = $`value[0]; } else { `$unimportant+= $`value[0]; } } rsort($importantContest); `$len = count($`importantContest); for (`$i=0; $`i < `$len; $`i++) { if(`$i < $`k) { `$unimportant+=$`importantContest[$i]; } else { `$unimportant-=$`importantContest[$i]; } } echo $unimportant;
Seems like cookies are disabled on this browser, please enable them to open this website
Luck Balance
You are viewing a single comment's thread. Return to all comments →
PHP solutions
unimportant = 0; foreach (key => $value) {