Cody

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

Solution 1349319

Submitted on 19 Nov 2017 by Nabor Reyna Jr.
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"))

s1 = "cody" s2 = 5 iter = 5 repStr = "cody" s = "cody" s = "codycody" s = "codycodycody" s = "codycodycodycody" s = "codycodycodycodycody"

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

s1 = "cody" s2 = 5 iter = 5 repStr = "cody" s = "cody" s = "codycody" s = "codycodycody" s = "codycodycodycody" s = "codycodycodycodycody" s1 = "cody" s2 = 2 iter = 2 repStr = "cody" s = "cody" s = "codycody" s1 = "cody" s2 = 3 iter = 3 repStr = "cody" s = "cody" s = "codycody" s = "codycodycody"

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

s1 = 3 s2 = " Cody is fun!" iter = 3 repStr = " Cody is fun!" s = " Cody is fun!" s = " Cody is fun! Cody is fun!" s = " 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))

s1 = " Cody 5-Year Anniversary!" s2 = 2 iter = 2 repStr = " Cody 5-Year Anniversary!" s = " Cody 5-Year Anniversary!" s = " 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))