Cody

Solution 1631647

Submitted on 21 Sep 2018 by Michael Jarboe
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
r_str = 'gbyrposGBR*'; c_corr = 1036; assert(isequal(rupee_count_compact(r_str),c_corr));

letters = 'gbyrposGBR*' values = 1 5 10 20 50 100 200 50 100 200 300

2   Pass
r_str = 'gggggggggggggggggggggggggggggggggggggggggggg'; c_corr = 44; assert(isequal(rupee_count_compact(r_str),c_corr));

letters = 'gbyrposGBR*' values = 1 5 10 20 50 100 200 50 100 200 300

3   Pass
r_str = 'gggbgggysgggrggggGygbog*gggyggbggrgggsbggbyGggbBggbgggysgggrggggbggrgggsbggbyGggbBgggGyggbggrgggsbggbyGggbBggrggggGygbog*gggyggbggrgggsbggbyGggbBggbggg'; c_corr = 3196; assert(isequal(rupee_count_compact(r_str),c_corr));

letters = 'gbyrposGBR*' values = 1 5 10 20 50 100 200 50 100 200 300

4   Pass
r_str = 'b'; n_r = randi(100); for i = 2:n_r r_str = strcat(r_str,'g'); end c_corr = 5 + n_r - 1; assert(isequal(rupee_count_compact(r_str),c_corr));

letters = 'gbyrposGBR*' values = 1 5 10 20 50 100 200 50 100 200 300