Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
r_str = 'gbyrposGBR*';
c_corr = 1036;
assert(isequal(rupee_count_compact(r_str),c_corr));
c =
16
c =
186
|
2 | Pass |
r_str = 'gggggggggggggggggggggggggggggggggggggggggggg';
c_corr = 44;
assert(isequal(rupee_count_compact(r_str),c_corr));
c =
44
c =
44
|
3 | Fail |
r_str = 'gggbgggysgggrggggGygbog*gggyggbggrgggsbggbyGggbBggbgggysgggrggggbggrgggsbggbyGggbBgggGyggbggrgggsbggbyGggbBggrggggGygbog*gggyggbggrgggsbggbyGggbBggbggg';
c_corr = 3196;
assert(isequal(rupee_count_compact(r_str),c_corr));
c =
306
c =
646
|
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));
c =
72
c =
72
|
The Goldbach Conjecture, Part 2
1286 Solvers
1366 Solvers
Project Euler: Problem 6, Natural numbers, squares and sums.
1018 Solvers
"Low : High - Low : High - Turn around " -- Create a subindices vector
320 Solvers
The sum of the numbers in the vector
426 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!