From 43c91f61880e6f8895835481630f934306a72cc8 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Wed, 25 Dec 2024 12:25:55 +0200 Subject: [PATCH 1/2] add a story --- exercises/luhn/introduction.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 exercises/luhn/introduction.md diff --git a/exercises/luhn/introduction.md b/exercises/luhn/introduction.md new file mode 100644 index 000000000..ec2bd709d --- /dev/null +++ b/exercises/luhn/introduction.md @@ -0,0 +1,11 @@ +# Introduction + +At the Global Verification Authority, you've just been entrusted with a critical assignment. +Across the city, from online purchases to secure logins, countless operations rely on the accuracy of numerical identifiers like credit card numbers, bank account numbers, transaction codes, and tracking IDs. +The Luhn algorithm is a simple checksum formula used to ensure these numbers are valid and error-free. + +A batch of identifiers has just arrived on your desk. +All of them must pass the Luhn test to ensure they're legitimate. +If any fail, they'll be flagged as invalid, preventing errors or fraud, such as incorrect transactions or unauthorized access. + +Can you ensure this is done right? The integrity of many services depends on you. From 70238249705c3cbf226057cb4a7202cedadeb2ab Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Wed, 25 Dec 2024 12:26:17 +0200 Subject: [PATCH 2/2] update instructions --- exercises/luhn/{description.md => instructions.md} | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) rename exercises/luhn/{description.md => instructions.md} (76%) diff --git a/exercises/luhn/description.md b/exercises/luhn/instructions.md similarity index 76% rename from exercises/luhn/description.md rename to exercises/luhn/instructions.md index 4ad2038f7..5bbf007b0 100644 --- a/exercises/luhn/description.md +++ b/exercises/luhn/instructions.md @@ -1,12 +1,10 @@ -# Description +# Instructions -Given a number determine whether or not it is valid per the Luhn formula. +Determine whether a credit card number is valid according to the [Luhn formula][luhn]. -The [Luhn algorithm][luhn] is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers and Canadian Social Insurance Numbers. +The number will be provided as a string. -The task is to check if a given string is valid. - -## Validating a Number +## Validating a number Strings of length 1 or less are not valid. Spaces are allowed in the input, but they should be stripped before checking.