I need your help to write a function that takes a list of letters like ['a', 'b', 'c'] and returns another list of letters like ['a', 'b', 'b', 'c', 'c', 'c'], this is the first element is repeated only once the second element is repeated two times, the third element is repeated three times, etc. Thank you in advance!.
(mapcat repeat (map inc (range)) ["a" "b" "c"])
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments