Cody

# Problem 1043. Generate a string like abbcccddddeeeee

Solution 2100600

Submitted on 21 Jan 2020 by anan jeraise
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
n = 1; y_correct = 'a'; assert(isequal(your_fcn_name(n),y_correct))

y = [] ch = 'a' rp = 'a' y = 'a'

2   Pass
r = 2; y_correct = 'abb'; assert(isequal(your_fcn_name(r),y_correct))

y = [] ch = 'a' rp = 'a' y = 'a' ch = 'b' rp = 'bb' y = 'abb'

3   Pass
n = 5; y_correct = 'abbcccddddeeeee'; assert(isequal(your_fcn_name(n),y_correct))

y = [] ch = 'a' rp = 'a' y = 'a' ch = 'b' rp = 'bb' y = 'abb' ch = 'c' rp = 'ccc' y = 'abbccc' ch = 'd' rp = 'dddd' y = 'abbcccdddd' ch = 'e' rp = 'eeeee' y = 'abbcccddddeeeee'

4   Pass
ty =18 s_correct ='abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrrr' assert(strcmp(your_fcn_name(ty),s_correct))

ty = 18 s_correct = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrrr' y = [] ch = 'a' rp = 'a' y = 'a' ch = 'b' rp = 'bb' y = 'abb' ch = 'c' rp = 'ccc' y = 'abbccc' ch = 'd' rp = 'dddd' y = 'abbcccdddd' ch = 'e' rp = 'eeeee' y = 'abbcccddddeeeee' ch = 'f' rp = 'ffffff' y = 'abbcccddddeeeeeffffff' ch = 'g' rp = 'ggggggg' y = 'abbcccddddeeeeeffffffggggggg' ch = 'h' rp = 'hhhhhhhh' y = 'abbcccddddeeeeeffffffggggggghhhhhhhh' ch = 'i' rp = 'iiiiiiiii' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiii' ch = 'j' rp = 'jjjjjjjjjj' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjj' ch = 'k' rp = 'kkkkkkkkkkk' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkk' ch = 'l' rp = 'llllllllllll' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllll' ch = 'm' rp = 'mmmmmmmmmmmmm' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmm' ch = 'n' rp = 'nnnnnnnnnnnnnn' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnn' ch = 'o' rp = 'ooooooooooooooo' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnooooooooooooooo' ch = 'p' rp = 'pppppppppppppppp' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnooooooooooooooopppppppppppppppp' ch = 'q' rp = 'qqqqqqqqqqqqqqqqq' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqq' ch = 'r' rp = 'rrrrrrrrrrrrrrrrrr' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrrr'

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!