CodeOath
← All problems

Flatten Array One Level

Medium
arrays

Flatten a nested array/list by exactly one level.

Example:

Input: arr = [[1, [2, 3]], 4]
Output: [1, [2, 3], 4]  // only one level is flattened