Course · Section 11: Working With Arrays · Lecture 170: flat and flatMap
Implement `duplicateEach(arr)` returning each element twice in place, using `flatMap`.
+ 1 hidden test run on Submit.
flatMap maps each element to a pair and flattens the result one level.
Run your code to see results.