Given a collection [2,3,4,5,6,7]
, how would you elegantly inject an arbitrary element between each element i.e. [2,1,3,1,4,1,5,1,6,1,7]
?
(However, [2]
and []
should remain unchanged, because there is no 'between' when the element count is less than two.)