Cody

Solution 503432

Submitted on 21 Sep 2014 by Abdullah Caliskan
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 = [1]; y = [1]; assert(isequal(individualNumSum(x),y))

k = 1 p = 1

2   Pass
%% x = [103]; y = [4]; assert(isequal(individualNumSum(x),y))

k = 103 p = 1 0 3 x = 4 k = 4 p = 4

3   Pass
%% x=[189 22 39 88 55 485 769 215 3685 4589]; y = [9 4 3 7 1 8 4 8 4 8]; assert(isequal(individualNumSum(x),y))

k = 189 p = 1 8 9 x = 18 22 39 88 55 485 769 215 3685 4589 k = 18 p = 1 8 x = 9 22 39 88 55 485 769 215 3685 4589 k = 9 p = 9 k = 22 p = 2 2 x = 9 4 39 88 55 485 769 215 3685 4589 k = 4 p = 4 k = 39 p = 3 9 x = 9 4 12 88 55 485 769 215 3685 4589 k = 12 p = 1 2 x = 9 4 3 88 55 485 769 215 3685 4589 k = 3 p = 3 k = 88 p = 8 8 x = 9 4 3 16 55 485 769 215 3685 4589 k = 16 p = 1 6 x = 9 4 3 7 55 485 769 215 3685 4589 k = 7 p = 7 k = 55 p = 5 5 x = 9 4 3 7 10 485 769 215 3685 4589 k = 10 p = 1 0 x = 9 4 3 7 1 485 769 215 3685 4589 k = 1 p = 1 k = 485 p = 4 8 5 x = 9 4 3 7 1 17 769 215 3685 4589 k = 17 p = 1 7 x = 9 4 3 7 1 8 769 215 3685 4589 k = 8 p = 8 k = 769 p = 7 6 9 x = 9 4 3 7 1 8 22 215 3685 4589 k = 22 p = 2 2 x = 9 4 3 7 1 8 4 215 3685 4589 k = 4 p = 4 k = 215 p = 2 1 5 x = 9 4 3 7 1 8 4 8 3685 4589 k = 8 p = 8 k = 3685 p = 3 6 8 5 x = 9 4 3 7 1 8 4 8 22 4589 k = 22 p = 2 2 x = 9 4 3 7 1 8 4 8 4 4589 k = 4 p = 4 k = 4589 p = 4 5 8 9 x = 9 4 3 7 1 8 4 8 4 26 k = 26 p = 2 6 x = 9 4 3 7 1 8 4 8 4 8 k = 8 p = 8

4   Pass
%% x=[1111 2222 3333 4444 5555 6666 7777 8888 9999 0]; y = [4 8 3 7 2 6 1 5 9 0]; assert(isequal(individualNumSum(x),y))

k = 1111 p = 1 1 1 1 x = 4 2222 3333 4444 5555 6666 7777 8888 9999 0 k = 4 p = 4 k = 2222 p = 2 2 2 2 x = 4 8 3333 4444 5555 6666 7777 8888 9999 0 k = 8 p = 8 k = 3333 p = 3 3 3 3 x = 4 8 12 4444 5555 6666 7777 8888 9999 0 k = 12 p = 1 2 x = 4 8 3 4444 5555 6666 7777 8888 9999 0 k = 3 p = 3 k = 4444 p = 4 4 4 4 x = 4 8 3 16 5555 6666 7777 8888 9999 0 k = 16 p = 1 6 x = 4 8 3 7 5555 6666 7777 8888 9999 0 k = 7 p = 7 k = 5555 p = 5 5 5 5 x = 4 8 3 7 20 6666 7777 8888 9999 0 k = 20 p = 2 0 x = 4 8 3 7 2 6666 7777 8888 9999 0 k = 2 p = 2 k = 6666 p = 6 6 6 6 x = 4 8 3 7 2 24 7777 8888 9999 0 k = 24 p = 2 4 x = 4 8 3 7 2 6 7777 8888 9999 0 k = 6 p = 6 k = 7777 p = 7 7 7 7 x = 4 8 3 7 2 6 28 8888 9999 0 k = 28 p = 2 8 x = 4 8 3 7 2 6 10 8888 9999 0 k = 10 p = 1 0 x = 4 8 3 7 2 6 1 8888 9999 0 k = 1 p = 1 k = 8888 p = 8 8 8 8 x = 4 8 3 7 2 6 1 32 9999 0 k = 32 p = 3 2 x = 4 8 3 7 2 6 1 5 9999 0 k = 5 p = 5 k = 9999 p = 9 9 9 9 x = 4 8 3 7 2 6 1 5 36 0 k = 36 p = 3 6 x = 4 8 3 7 2 6 1 5 9 0 k = 9 p = 9 k = 0 p = 0

5   Pass
%% x=[111 222 333 444 555 666 777 888 999 0]; y = [3 6 9 3 6 9 3 6 9 0]; assert(isequal(individualNumSum(x),y))

k = 111 p = 1 1 1 x = 3 222 333 444 555 666 777 888 999 0 k = 3 p = 3 k = 222 p = 2 2 2 x = 3 6 333 444 555 666 777 888 999 0 k = 6 p = 6 k = 333 p = 3 3 3 x = 3 6 9 444 555 666 777 888 999 0 k = 9 p = 9 k = 444 p = 4 4 4 x = 3 6 9 12 555 666 777 888 999 0 k = 12 p = 1 2 x = 3 6 9 3 555 666 777 888 999 0 k = 3 p = 3 k = 555 p = 5 5 5 x = 3 6 9 3 15 666 777 888 999 0 k = 15 p = 1 5 x = 3 6 9 3 6 666 777 888 999 0 k = 6 p = 6 k = 666 p = 6 6 6 x = 3 6 9 3 6 18 777 888 999 0 k = 18 p = 1 8 x = 3 6 9 3 6 9 777 888 999 0 k = 9 p = 9 k = 777 p = 7 7 7 x = 3 6 9 3 6 9 21 888 999 0 k = 21 p = 2 1 x = 3 6 9 3 6 9 3 888 999 0 k = 3 p = 3 k = 888 p = 8 8 8 x = 3 6 9 3 6 9 3 24 999 0 k = 24 p = 2 4 x = 3 6 9 3 6 9 3 6 999 0 k = 6 p = 6 k = 999 p = 9 9 9 x = 3 6 9 3 6 9 3 6 27 0 k = 27 p = 2 7 x = 3 6 9 3 6 9 3 6 9 0 k = 9 p = 9 k = 0 p = 0

6   Pass
%% x=[11 3]; y = [2 3]; assert(isequal(individualNumSum(x),y))

k = 11 p = 1 1 x = 2 3 k = 2 p = 2 k = 3 p = 3