You are viewing a single comment's thread. Return to all comments →
JavaScript
function bonAppetit(bill, k, b) { bill.splice(k, 1); let billSum = bill.reduce((acc, curValue) => acc + curValue, 0) / 2; let toBeRefund = b - billSum; return console.log(billSum === b ? "Bon Appetit" : toBeRefund); } }
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 →
JavaScript