Cody

Problem 42918. Addition Partition

Solution 1050049

Submitted on 10 Nov 2016 by Binbin Qi
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
N=5;K=3; assert(isequal(num_sum(N,K),5))

ans = 5

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

ans = 11

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

ans = 8

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

ans = 110

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

ans = 108

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

ans = 73

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

ans = 21

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

ans = 7

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

ans = 8

Suggested Problems

More from this Author80

Community Treasure Hunt

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

Start Hunting!