• + 0 comments

    Here's my PHP solution:

    function bonAppetit($bill, $k, $b) {
        // Write your code here
        unset($bill[$k]);
        $fairAmount = array_sum($bill)/2;
        $remaining = $b - $fairAmount;
    
        echo $remaining ?: 'Bon Appetit';
    }