Cody

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

Solution 1949482

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 = 16

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 = 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 = 306

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 = 38

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!