Cody

Solution 162612

Submitted on 15 Nov 2012 by Brig
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(:)))

ans = 2 a = 57.6801 ans = 2 1 a = 7.6802 ans = 2 1 0 a = 7.6803 ans = 2 1 0 0 a = 7.6804 ans = 2 1 0 0 1 a = 2.6805 ans = 2 1 0 0 1 1 a = 0.6806 ans = 2 1 0 0 1 1 0 a = 0.6807 ans = 2 1 0 0 1 1 0 1 a = 0.1808 ans = 2 1 0 0 1 1 0 1 0 a = 0.1809 ans = 2 1 0 0 1 1 0 1 0 1 a = 0.0810 ans = 2 1 0 0 1 1 0 1 0 1 1 a = 0.0311 ans = 2 1 0 0 1 1 0 1 0 1 1 3 a = 0.0012

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(:)))

ans = 1 a = 35.0101 ans = 1 0 a = 35.0102 ans = 1 0 1 a = 15.0103 ans = 1 0 1 1 a = 5.0104 ans = 1 0 1 1 1 a = 0.0105 ans = 1 0 1 1 1 0 a = 0.0106 ans = 1 0 1 1 1 0 0 a = 0.0107 ans = 1 0 1 1 1 0 0 0 a = 0.0108 ans = 1 0 1 1 1 0 0 0 0 a = 0.0109 ans = 1 0 1 1 1 0 0 0 0 0 a = 0.0110 ans = 1 0 1 1 1 0 0 0 0 0 0 a = 0.0111 ans = 1 0 1 1 1 0 0 0 0 0 0 1 a = 0.0012

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(:)))

ans = 100 a = 35.9901 ans = 100 0 a = 35.9902 ans = 100 0 1 a = 15.9903 ans = 100 0 1 1 a = 5.9904 ans = 100 0 1 1 1 a = 0.9905 ans = 100 0 1 1 1 0 a = 0.9906 ans = 100 0 1 1 1 0 0 a = 0.9907 ans = 100 0 1 1 1 0 0 1 a = 0.4908 ans = 100 0 1 1 1 0 0 1 1 a = 0.2409 ans = 100 0 1 1 1 0 0 1 1 2 a = 0.0410 ans = 100 0 1 1 1 0 0 1 1 2 0 a = 0.0411 ans = 100 0 1 1 1 0 0 1 1 2 0 4 a = 0.0012