Cody

# Problem 45490. Luhn's Algorithm

Solution 2249984

Submitted on 2 May 2020 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = '0'; assert(isequal(luhn(x),'00'));

s = 0 ss = '0'

2   Pass
x = '1'; assert(isequal(luhn(x),'12'));

s = 2 ss = '2'

3   Pass
x = '5'; assert(isequal(luhn(x),'51'));

s = 1 ss = '1'

4   Pass
x = '9'; assert(isequal(luhn(x),'99'));

s = 9 ss = '9'

5   Pass
x = '10'; assert(isequal(luhn(x),'101'));

s = 1 ss = '1'

6   Pass
x = '80'; assert(isequal(luhn(x),'808'));

s = 8 ss = '8'

7   Pass
x = '080'; assert(isequal(luhn(x),'0808'));

s = 8 ss = '8'

8   Pass
x = '180'; assert(isequal(luhn(x),'1800'));

s = 10 ss = '10'

9   Pass
x = '1234567890'; assert(isequal(luhn(x),'12345678907'));

s = 47 ss = '47'

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!