Cody

# Problem 44313. "Cody" * 5 == "CodyCodyCodyCodyCody"

Solution 1293137

Submitted on 17 Oct 2017 by Reggie Wilcox
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
assessFunctionAbsence({'regexp','regexpi','regexprep','str2num'},'FileName','mtimes.m')

2   Pass
assert(isequal("cody" * 5, "codycodycodycodycody"))

str = "cody" n = 5 y = "cody" y = "codycody" y = "codycodycody" y = "codycodycodycody" y = "codycodycodycodycody"

3   Pass
assert(isequal("cody" * 5, "cody" * 2 + "cody" * 3))

str = "cody" n = 5 y = "cody" y = "codycody" y = "codycodycody" y = "codycodycodycody" y = "codycodycodycodycody" str = "cody" n = 2 y = "cody" y = "codycody" str = "cody" n = 3 y = "cody" y = "codycody" y = "codycodycody"

4   Pass
assert(isequal(" Cody is fun! Cody is fun! Cody is fun!", 3 * " Cody is fun!"))

str = " Cody is fun!" n = 3 y = " Cody is fun!" y = " Cody is fun! Cody is fun!" y = " Cody is fun! Cody is fun! Cody is fun!"

5   Pass
assert(isequal(" Cody 5-Year Anniversary! Cody 5-Year Anniversary!", " Cody 5-Year Anniversary!" * 2))

str = " Cody 5-Year Anniversary!" n = 2 y = " Cody 5-Year Anniversary!" y = " Cody 5-Year Anniversary! Cody 5-Year Anniversary!"

6   Pass
x = ["Cody";"matlab";"Simulink";"@Mathworks"] + (5:5:randi([1000,5000])); assert(isequal(x*2,x+x)) assert(isequal(x*3,x+x+x)) assert(isequal(5*x,x+x+x+x+x)) assert(isequal(101*x,x+100*x))