Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
str = 'b';n=5
y_correct = 'bbbbb';
assert(isequal(duplicate_char(str,n),y_correct))
n =
5
|
2 | Pass |
str = 's';n=1
y_correct = 's';
assert(isequal(duplicate_char(str,n),y_correct))
n =
1
|
3 | Pass |
str = 'b';n=10
y_correct = 'bbbbbbbbbb';
assert(isequal(duplicate_char(str,n),y_correct))
n =
10
|
4 | Pass |
str = 'b';n=0
y_correct = '';
assert(isequal(duplicate_char(str,n),y_correct))
n =
0
|
5 | Pass |
str = '?';n=2
y_correct = '??';
assert(isequal(duplicate_char(str,n),y_correct))
n =
2
|
Project Euler: Problem 6, Natural numbers, squares and sums.
784 Solvers
Flip the main diagonal of a matrix
426 Solvers
Get the length of a given vector
1371 Solvers
Return the first and last character of a string
1662 Solvers
Find nearest prime number less than input number
183 Solvers