Given a string of text, output it as a 'tower'.
Each slice of the string (of the form 0:n
) is repeated 5*n
times, so the first character is repeated 5 times, then the first and the second 10 times, etc.
Examples:
'hello' ->
['h']
['h']
['h']
['h']
['h']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
['h', 'e', 'l', 'l', 'o']
'cat' ->
['c']
['c']
['c']
['c']
['c']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
['c', 'a', 't']
Rules:
You can output each layer as a list of characters or just a string of them joined together.
[["c","c","c","c","c"],["ca","ca","ca","ca","ca","ca","ca","ca","ca","ca"],...]
? \$\endgroup\$