Skip to content

luhnchecksum

bradendubois edited this page Jun 9, 2021 · 6 revisions

Luhn's Checksum Algorithm

ID: luhnchecksum

Difficulty: 1.6

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, finding some way to iterate through individual elements of the number will help. This can be done by iterating through the number (as a string) andconverting the relevant digits to numbers, or dividing by 100 to move the next 'digit' into the right-most position, etc.

Clone this wiki locally