Cody

Solution 1913053

Submitted on 27 Aug 2019 by Virtual AS
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 = 3276; y_correct = 5; assert(isequal(KaprekarSteps(x),y_correct))

n = 3276 n = 5265 n = 3996 n = 6264 n = 4176 n = 6174

2   Pass
x = 3; y_correct = 6; assert(isequal(KaprekarSteps(x),y_correct))

n = 3 n = 2997 n = 7173 n = 6354 n = 3087 n = 8352 n = 6174

3   Pass
x = 691; y_correct = 7; assert(isequal(KaprekarSteps(x),y_correct))

n = 691 n = 9441 n = 7992 n = 7173 n = 6354 n = 3087 n = 8352 n = 6174

4   Pass
x = 3333; y_correct = Inf; assert(isequal(KaprekarSteps(x),y_correct))

n = 3333 n = 0 y = Inf

5   Pass
x = 1; y_correct = 5; assert(isequal(KaprekarSteps(x),y_correct))

n = 1 n = 999 n = 8991 n = 8082 n = 8532 n = 6174

6   Pass
x = 6174; y_correct = 0; assert(isequal(KaprekarSteps(x),y_correct))

n = 6174

7   Pass
x = 1234; y_correct = 3; assert(isequal(KaprekarSteps(x),y_correct))

n = 1234 n = 3087 n = 8352 n = 6174

8   Pass
x = 3141; y_correct = 5; assert(isequal(KaprekarSteps(x),y_correct))

n = 3141 n = 3177 n = 6354 n = 3087 n = 8352 n = 6174

9   Pass
x = 8080; y_correct = 6; assert(isequal(KaprekarSteps(x),y_correct))

n = 8080 n = 8712 n = 7443 n = 3996 n = 6264 n = 4176 n = 6174