From 6cb24427862a8265294c304747c5a62b2906b7d9 Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Wed, 27 Oct 2021 22:42:12 +0900 Subject: [PATCH] chore: fix typo --- source/_posts/2021/split-bill.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/_posts/2021/split-bill.md b/source/_posts/2021/split-bill.md index be4a3f8..a2b7288 100644 --- a/source/_posts/2021/split-bill.md +++ b/source/_posts/2021/split-bill.md @@ -61,13 +61,13 @@ const data = new Map(); for (const { payer, amount, involves } of history) { const record = data.fetch(payer); record.balance += amount; - const dept = Math.ceil(amount / involves.length); - // actual payer should not owe extra dept coming from rounded up numbers - const payerDept = amount - dept * (involves.length - 1); - for (const deptor of involves.map((i) => data.fetch(i))) { + const debt = Math.ceil(amount / involves.length); + // actual payer should not owe extra debt coming from rounded up numbers + const payerDebt = amount - debt * (involves.length - 1); + for (const debtor of involves.map((i) => data.fetch(i))) { const cost = Math.round(amount / involves.length); - deptor.balance -= cost; - deptor.consumption += cost; + debtor.balance -= cost; + debtor.consumption += cost; } }