📌  相关文章
📜  比尔司hackerrank解决方案javascript代码示例

📅  最后修改于: 2022-03-11 15:01:46.310000             🧑  作者: Mango

代码示例1
// 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);
  }
}