Cody

Problem 1043. Generate a string like abbcccddddeeeee

Solution 2106005

Submitted on 26 Jan 2020 by lior dmitrichenko
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 = [] y = [] r = 1 l = 97 y = 97 y = 'a'

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

y = [] y = [] r = 1 l = 97 y = 97 y = 'a' r = 2 l = 98 98 y = 'abb' y = 'abb'

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

y = [] y = [] r = 1 l = 97 y = 97 y = 'a' r = 2 l = 98 98 y = 'abb' y = 'abb' r = 3 l = 99 99 99 y = 'abbccc' y = 'abbccc' r = 4 l = 100 100 100 100 y = 'abbcccdddd' y = 'abbcccdddd' r = 5 l = 101 101 101 101 101 y = 'abbcccddddeeeee' y = 'abbcccddddeeeee'

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

ty = 18 s_correct = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrrr' y = [] y = [] r = 1 l = 97 y = 97 y = 'a' r = 2 l = 98 98 y = 'abb' y = 'abb' r = 3 l = 99 99 99 y = 'abbccc' y = 'abbccc' r = 4 l = 100 100 100 100 y = 'abbcccdddd' y = 'abbcccdddd' r = 5 l = 101 101 101 101 101 y = 'abbcccddddeeeee' y = 'abbcccddddeeeee' r = 6 l = 102 102 102 102 102 102 y = 'abbcccddddeeeeeffffff' y = 'abbcccddddeeeeeffffff' r = 7 l = 103 103 103 103 103 103 103 y = 'abbcccddddeeeeeffffffggggggg' y = 'abbcccddddeeeeeffffffggggggg' r = 8 l = 104 104 104 104 104 104 104 104 y = 'abbcccddddeeeeeffffffggggggghhhhhhhh' y = 'abbcccddddeeeeeffffffggggggghhhhhhhh' r = 9 l = 105 105 105 105 105 105 105 105 105 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiii' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiii' r = 10 l = 106 106 106 106 106 106 106 106 106 106 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjj' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjj' r = 11 l = 107 107 107 107 107 107 107 107 107 107 107 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkk' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkk' r = 12 l = 108 108 108 108 108 108 108 108 108 108 108 108 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllll' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllll' r = 13 l = 109 109 109 109 109 109 109 109 109 109 109 109 109 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmm' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmm' r = 14 l = 110 110 110 110 110 110 110 110 110 110 110 110 110 110 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnn' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnn' r = 15 l = 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnooooooooooooooo' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnooooooooooooooo' r = 16 l = 112 112 112 112 112 112 112 112 112 112 112 112 112 112 112 112 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnooooooooooooooopppppppppppppppp' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnooooooooooooooopppppppppppppppp' r = 17 l = 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 113 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqq' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqq' r = 18 l = 114 114 114 114 114 114 114 114 114 114 114 114 114 114 114 114 114 114 y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrrr' y = 'abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrrr'