i want to expand a list
[1,2,3,4]
by n
e.g. for n = 2:
[1,1,2,2,3,3,4,4]
I’m searching for the smallest possible way to achieve this without any additional librarys.
Its easy to do a loop and append each item n times to a new list… but is there a other way?
1 Answer