Problem 2625 · Medium

Flatten Deeply Nested Array

Walk the nested array, opening a list only while depth remains, and append everything else in order.

Open the interactive visualisation