From 354f3afa7c6046a9dc80928c7595db33582cb863 Mon Sep 17 00:00:00 2001 From: Muhammad Mahmood Date: Mon, 11 Sep 2023 15:24:05 +0100 Subject: [PATCH] Corrected Luhn's Algorithm Step 3 (#1194) In the exercise guideline for the Luhn's algorithm (Day 1, Afternoon exercise), I made a correction to step 3 to provide a more accurate explanation. Instead of stating that doubling 7 becomes 14, I clarified that doubling 7 results in 14, and we should sum the individual digits of 14 to get the correct value of 5. --- src/exercises/day-1/luhn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exercises/day-1/luhn.md b/src/exercises/day-1/luhn.md index ca8a49e8..d4e7f15a 100644 --- a/src/exercises/day-1/luhn.md +++ b/src/exercises/day-1/luhn.md @@ -9,8 +9,8 @@ following to validate the credit card number: * Moving from **right to left**, double every second digit: for the number `1234`, we double `3` and `1`. For the number `98765`, we double `6` and `8`. -* After doubling a digit, sum the digits. So doubling `7` becomes `14` which - becomes `5`. +* After doubling a digit, sum the digits if the result is greater than 9. So doubling `7` becomes `14` which + becomes `1 + 4 = 5`. * Sum all the undoubled and doubled digits.