Cody

Solution 242542

Submitted on 10 May 2013 by Cor van Essen
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
%% a = [257.68]; b = [2 1 0 0 1 1 0 1 0 1 1 3]; out = makingChange(a); assert(isequal(out(:), b(:)))

vec = 2 0 0 0 0 0 0 0 0 0 0 0 rest = 5768 vec = 2 1 0 0 0 0 0 0 0 0 0 0 rest = 768 vec = 2 1 0 0 0 0 0 0 0 0 0 0 rest = 768 vec = 2 1 0 0 0 0 0 0 0 0 0 0 rest = 768 vec = 2 1 0 0 1 0 0 0 0 0 0 0 rest = 268 vec = 2 1 0 0 1 1 0 0 0 0 0 0 rest = 68 vec = 2 1 0 0 1 1 0 0 0 0 0 0 rest = 68 vec = 2 1 0 0 1 1 0 1 0 0 0 0 rest = 18 vec = 2 1 0 0 1 1 0 1 0 0 0 0 rest = 18 vec = 2 1 0 0 1 1 0 1 0 1 0 0 rest = 8 vec = 2 1 0 0 1 1 0 1 0 1 1 0 rest = 3 vec = 2 1 0 0 1 1 0 1 0 1 1 3 rest = 0

2   Pass
%% a = [135.01]; b = [1 0 1 1 1 0 0 0 0 0 0 1]; out = makingChange(a); assert(isequal(out(:), b(:)))

vec = 1 0 0 0 0 0 0 0 0 0 0 0 rest = 3501 vec = 1 0 0 0 0 0 0 0 0 0 0 0 rest = 3501 vec = 1 0 1 0 0 0 0 0 0 0 0 0 rest = 1501 vec = 1 0 1 1 0 0 0 0 0 0 0 0 rest = 501 vec = 1 0 1 1 1 0 0 0 0 0 0 0 rest = 1 vec = 1 0 1 1 1 0 0 0 0 0 0 0 rest = 1 vec = 1 0 1 1 1 0 0 0 0 0 0 0 rest = 1 vec = 1 0 1 1 1 0 0 0 0 0 0 0 rest = 1 vec = 1 0 1 1 1 0 0 0 0 0 0 0 rest = 1 vec = 1 0 1 1 1 0 0 0 0 0 0 0 rest = 1 vec = 1 0 1 1 1 0 0 0 0 0 0 0 rest = 1 vec = 1 0 1 1 1 0 0 0 0 0 0 1 rest = 0

3   Pass
%% a = [10035.99]; b = [100 0 1 1 1 0 0 1 1 2 0 4]; out = makingChange(a); assert(isequal(out(:), b(:)))

vec = 100 0 0 0 0 0 0 0 0 0 0 0 rest = 3599 vec = 100 0 0 0 0 0 0 0 0 0 0 0 rest = 3599 vec = 100 0 1 0 0 0 0 0 0 0 0 0 rest = 1599 vec = 100 0 1 1 0 0 0 0 0 0 0 0 rest = 599 vec = 100 0 1 1 1 0 0 0 0 0 0 0 rest = 99 vec = 100 0 1 1 1 0 0 0 0 0 0 0 rest = 99 vec = 100 0 1 1 1 0 0 0 0 0 0 0 rest = 99 vec = 100 0 1 1 1 0 0 1 0 0 0 0 rest = 49 vec = 100 0 1 1 1 0 0 1 1 0 0 0 rest = 24 vec = 100 0 1 1 1 0 0 1 1 2 0 0 rest = 4 vec = 100 0 1 1 1 0 0 1 1 2 0 0 rest = 4 vec = 100 0 1 1 1 0 0 1 1 2 0 4 rest = 0