Cody

# Problem 3026. Legend of Zelda - Rupee Count (Compact)

Solution 1949455

Submitted on 26 Sep 2019
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   Fail
r_str = 'gbyrposGBR*'; c_corr = 1036; assert(isequal(rupee_count_compact(r_str),c_corr));

ans = 1

Output argument "c" (and maybe others) not assigned during call to "rupee_count_compact". Error in Test1 (line 3) assert(isequal(rupee_count_compact(r_str),c_corr));

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

ans = Columns 1 through 29 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Columns 30 through 44 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

Output argument "c" (and maybe others) not assigned during call to "rupee_count_compact". Error in Test2 (line 3) assert(isequal(rupee_count_compact(r_str),c_corr));

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

ans = Columns 1 through 29 1 2 3 5 6 7 10 11 12 14 15 16 17 20 23 25 26 27 29 30 32 33 35 36 37 40 41 45 46 Columns 30 through 58 49 50 52 53 54 57 58 59 61 62 63 64 66 67 69 70 71 74 75 79 80 83 84 85 88 89 91 92 94 Columns 59 through 87 95 96 99 100 104 105 108 109 111 112 113 114 117 120 122 123 124 126 127 129 130 132 133 134 137 138 142 143 146 Columns 88 through 91 147 149 150 151

Output argument "c" (and maybe others) not assigned during call to "rupee_count_compact". Error in Test3 (line 3) assert(isequal(rupee_count_compact(r_str),c_corr));

4   Fail
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));

ans = Columns 1 through 29 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Columns 30 through 53 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

Output argument "c" (and maybe others) not assigned during call to "rupee_count_compact". Error in Test4 (line 7) assert(isequal(rupee_count_compact(r_str),c_corr));

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!