Flatten a Multi-Level Linked List in Depth-first way
Problem Given a linked list where each node has a next pointer and a child pointer that can point to a separate, nested list, flatten the list so that all nodes appear in a single-level, depth-first order. Examples Example 1: Input: head = [1, [2, [5, 6] ], 3, 4] 1 -> 2 -> 3 -> 4 | 5 -> 6 Output: 1 -> 2 -> 5 -> 6 -> 3 -> 4 ...