Cody

Solution 386218

Submitted on 15 Jan 2014 by Guillaume
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))

ans = 3276 ans = 5265 ans = 3996 ans = 6264 ans = 4176

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

ans = 0003 ans = 2997 ans = 7173 ans = 6354 ans = 3087 ans = 8352

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

ans = 0691 ans = 9441 ans = 7992 ans = 7173 ans = 6354 ans = 3087 ans = 8352

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

ans = 3333

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

ans = 0001 ans = 0999 ans = 8991 ans = 8082 ans = 8532

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

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

ans = 1234 ans = 3087 ans = 8352

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

ans = 3141 ans = 3177 ans = 6354 ans = 3087 ans = 8352

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

ans = 8080 ans = 8712 ans = 7443 ans = 3996 ans = 6264 ans = 4176

Suggested Problems

More from this Author95