• + 0 comments

    Here is my c++ solution you can find the video here : https://youtu.be/MHFroRIBGQc

    void bonAppetit(vector<int> bill, int k, int b) {
        int s = accumulate(bill.begin(), bill.end(), -1 * bill[k]);
        int c = s / 2;
        if(c == b) cout << "Bon Appetit";
        else cout << b - c;
    }