Cody

# Problem 48. Making change

Solution 166256

Submitted on 21 Nov 2012 by Slobodan Ilic
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(:)))

b = 2.00 a = 57680.00 b = 2.00 1.00 a = 7680.00 b = 2.00 1.00 0 a = 7680.00 b = 2.00 1.00 0 0 a = 7680.00 b = 2.00 1.00 0 0 1.00 a = 2680.00 b = 2.00 1.00 0 0 1.00 1.00 a = 680.00 b = 2.00 1.00 0 0 1.00 1.00 0 a = 680.00 b = Columns 1 through 7 2.00 1.00 0 0 1.00 1.00 0 Column 8 1.00 a = 180.00 b = Columns 1 through 7 2.00 1.00 0 0 1.00 1.00 0 Columns 8 through 9 1.00 0 a = 180.00 b = Columns 1 through 7 2.00 1.00 0 0 1.00 1.00 0 Columns 8 through 10 1.00 0 1.00 a = 80.00 b = Columns 1 through 7 2.00 1.00 0 0 1.00 1.00 0 Columns 8 through 11 1.00 0 1.00 1.00 a = 30.00 b = Columns 1 through 7 2.00 1.00 0 0 1.00 1.00 0 Columns 8 through 12 1.00 0 1.00 1.00 3.00 a = 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(:)))

b = 1.00 a = 35010.00 b = 1.00 0 a = 35010.00 b = 1.00 0 1.00 a = 15010.00 b = 1.00 0 1.00 1.00 a = 5010.00 b = 1.00 0 1.00 1.00 1.00 a = 10.00 b = 1.00 0 1.00 1.00 1.00 0 a = 10.00 b = 1.00 0 1.00 1.00 1.00 0 0 a = 10.00 b = Columns 1 through 7 1.00 0 1.00 1.00 1.00 0 0 Column 8 0 a = 10.00 b = Columns 1 through 7 1.00 0 1.00 1.00 1.00 0 0 Columns 8 through 9 0 0 a = 10.00 b = Columns 1 through 7 1.00 0 1.00 1.00 1.00 0 0 Columns 8 through 10 0 0 0 a = 10.00 b = Columns 1 through 7 1.00 0 1.00 1.00 1.00 0 0 Columns 8 through 11 0 0 0 0 a = 10.00 b = Columns 1 through 7 1.00 0 1.00 1.00 1.00 0 0 Columns 8 through 12 0 0 0 0 1.00 a = 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(:)))

b = 100.00 a = 35990.00 b = 100.00 0 a = 35990.00 b = 100.00 0 1.00 a = 15990.00 b = 100.00 0 1.00 1.00 a = 5990.00 b = 100.00 0 1.00 1.00 1.00 a = 990.00 b = 100.00 0 1.00 1.00 1.00 0 a = 990.00 b = 100.00 0 1.00 1.00 1.00 0 0 a = 990.00 b = Columns 1 through 7 100.00 0 1.00 1.00 1.00 0 0 Column 8 1.00 a = 490.00 b = Columns 1 through 7 100.00 0 1.00 1.00 1.00 0 0 Columns 8 through 9 1.00 1.00 a = 240.00 b = Columns 1 through 7 100.00 0 1.00 1.00 1.00 0 0 Columns 8 through 10 1.00 1.00 2.00 a = 40.00 b = Columns 1 through 7 100.00 0 1.00 1.00 1.00 0 0 Columns 8 through 11 1.00 1.00 2.00 0 a = 40.00 b = Columns 1 through 7 100.00 0 1.00 1.00 1.00 0 0 Columns 8 through 12 1.00 1.00 2.00 0 4.00 a = 0