You are viewing a single comment's thread. Return to all comments →
Did just that
string bonAppetit(int n, int k, int b, vector <int> ar) { int actual_split; int charged_split = b; string res = ""; actual_split = (accumulate(ar.begin(), ar.end(), 0)/2) - (ar[k]/2); if(charged_split - actual_split == 0){ res = "Bon Appetit"; }else{ res = to_string(charged_split - actual_split); } return(res); }
Seems like cookies are disabled on this browser, please enable them to open this website
Bill Division
You are viewing a single comment's thread. Return to all comments →
Did just that