Cody

Solution 977379

Submitted on 20 Sep 2016
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   Fail
N=5;K=3; assert(isequal(num_sum(N,K),5))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

2   Fail
N=7;K=4; assert(isequal(num_sum(N,K),11))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

3   Fail
N=7;K=3; assert(isequal(num_sum(N,K),8))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

4   Fail
N=15;K=6; assert(isequal(num_sum(N,K),110))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

5   Fail
N=20;K=4; assert(isequal(num_sum(N,K),108))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

6   Fail
N=12;K=9; assert(isequal(num_sum(N,K),73))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

7   Fail
N=13;K=3; assert(isequal(num_sum(N,K),21))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

8   Fail
N=12;K=2; assert(isequal(num_sum(N,K),7))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

9   Fail
N=15;K=2; assert(isequal(num_sum(N,K),8))

Error using num_sum (line 2) Undefined function 'cummsum' for input arguments of type 'double'.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!