📅  最后修改于: 2022-03-11 15:01:46.310000             🧑  作者: Mango
// Bill Division hackerrank solution javascript
function bonAppetit(bill, k, b) {
// Write your code here
let anna = bill[k];
let total = bill.reduce((x, y) => x + y);
let totalLessAnna = total - anna;
let actual = totalLessAnna / 2;
if (b - actual === 0) {
console.log("Bon Appetit");
} else {
console.log(b - actual);
}
}