Cody

# Problem 1925. Smith numbers

Solution 1957001

Submitted on 3 Oct 2019 by Doan Quang Manh
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 = 4; tf_correct = true; assert(isequal(isSmith(x),tf_correct ))

a = '4' b = '2 2' b = '22' q = 4 w = 2 w = 4 tf = logical 1

2   Pass
x = 265; tf_correct = true; assert(isequal(isSmith(x),tf_correct ))

a = '265' b = '5 53' b = '553' q = 2 q = 8 q = 13 w = 5 w = 10 w = 13 tf = logical 1

3   Pass
x = 588; tf_correct = true; assert(isequal(isSmith(x),tf_correct ))

a = '588' b = '2 2 3 7 7' b = '22377' q = 5 q = 13 q = 21 w = 2 w = 4 w = 7 w = 14 w = 21 tf = logical 1

4   Pass
x = 1086; tf_correct = true; assert(isequal(isSmith(x),tf_correct ))

a = '1086' b = '2 3 181' b = '23181' q = 1 q = 1 q = 9 q = 15 w = 2 w = 5 w = 6 w = 14 w = 15 tf = logical 1

5   Pass
x = 4937775; tf_correct = true; assert(isequal(isSmith(x),tf_correct ))

a = '4937775' b = '3 5 5 65837' b = '35565837' q = 4 q = 13 q = 16 q = 23 q = 30 q = 37 q = 42 w = 3 w = 8 w = 13 w = 19 w = 24 w = 32 w = 35 w = 42 tf = logical 1

6   Pass
x = 5; tf_correct = false; assert(isequal(isSmith(x),tf_correct ))

tf = logical 0

7   Pass
x = 1000; tf_correct = false; assert(isequal(isSmith(x),tf_correct ))

a = '1000' b = '2 2 2 5 5 5' b = '222555' q = 1 q = 1 q = 1 q = 1 w = 2 w = 4 w = 6 w = 11 w = 16 w = 21 tf = logical 0

8   Pass
x = 94.1; tf_correct = false; assert(isequal(isSmith(x),tf_correct ))

tf = logical 0

9   Pass
x = 202.689; tf_correct = false; assert(isequal(isSmith(x),tf_correct ))

tf = logical 0

10   Pass
x = pi; tf_correct = false; assert(isequal(isSmith(x),tf_correct ))

tf = logical 0

11   Pass
x = -4; tf_correct = false; assert(isequal(isSmith(x),tf_correct ))

tf = logical 0