August 27, 2024

P14 - Duplicate the elements of a list.

Example:

scala

scala> duplicate(List('a, 'b, 'c, 'c, 'd))
res0: List[Symbol] = List('a, 'a, 'b, 'b, 'c, 'c, 'c, 'c, 'd, 'd)
Be first to comment
Leave a reply