Cody

# Problem 1737. The sum of individual numbers...

Solution 2074804

Submitted on 30 Dec 2019
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))

y = 1 ans = 1

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

y = 1 0 3 ans = 4

3   Fail
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))

y = Columns 1 through 30 1 8 9 -16 -16 -16 -16 2 2 -16 -16 -16 -16 3 9 -16 -16 -16 -16 8 8 -16 -16 -16 -16 5 5 -16 -16 -16 Columns 31 through 57 4 8 5 -16 -16 -16 7 6 9 -16 -16 -16 2 1 5 -16 -16 3 6 8 5 -16 -16 4 5 8 9 ans = -309

Assertion failed.

4   Fail
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))

y = Columns 1 through 30 1 1 1 1 -16 -16 2 2 2 2 -16 -16 3 3 3 3 -16 -16 4 4 4 4 -16 -16 5 5 5 5 -16 -16 Columns 31 through 58 6 6 6 6 -16 -16 7 7 7 7 -16 -16 8 8 8 8 -16 -16 9 9 9 9 -16 -16 -16 -16 -16 0 ans = -156

Assertion failed.

5   Fail
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))

y = Columns 1 through 30 1 1 1 -16 -16 2 2 2 -16 -16 3 3 3 -16 -16 4 4 4 -16 -16 5 5 5 -16 -16 6 6 6 -16 -16 Columns 31 through 48 7 7 7 -16 -16 8 8 8 -16 -16 9 9 9 -16 -16 -16 -16 0 ans = -185

Assertion failed.

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

y = 1 1 -16 -16 -16 3 ans = -43

Assertion failed.