Cody

Solution 857249

Submitted on 26 Mar 2016 by Richard Zapor
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 2 3 4 5 6 7]; xi = split_it(x); assert(isequal(sum(x(xi)),sum(x)/2));

1 6 7 Elapsed time is 0.000364 seconds.

2   Pass
x = [2 2 2 2 2 2]; xi = split_it(x); assert(isequal(sum(x(xi)),sum(x)/2));

3 4 6 Elapsed time is 0.001051 seconds.

3   Pass
x = [2 5 4 5 4]; xi = split_it(x); assert(isequal(sum(x(xi)),sum(x)/2));

1 3 5 Elapsed time is 0.000123 seconds.

4   Pass
x = [1 3 1 1 9 7]; xi = split_it(x); assert(isequal(sum(x(xi)),sum(x)/2));

1 2 6 Elapsed time is 0.003127 seconds.

5   Pass
x = primes(100); xi = split_it(x); assert(isequal(sum(x(xi)),sum(x)/2));

2 3 4 5 6 7 10 12 15 16 18 20 22 25 Elapsed time is 0.001863 seconds.