Assuming the desired flattened liked list is to always move lower level list up right after bifurcation node, and attach the remaining list after the flattened link, then we can do DFS to locate bifurcation node on each level and modify its next pointer to point to the flattened list of lower level. Finally, we need to set down pointer in each node to `NULL`

since the returned list must be flattened.

```
struct Node { // define multi-level linked list node
Node* next, *down;
Node():next(NULL), down(NULL) { }
};
Node* flatten(Node* head) {
if (!head) return NULL;
Node* cur = head;
while (cur && !cur->down) cur = cur->next; // find bifurcation node
if (!cur) return head; // if no bifurcation, just return
Node* nxt = cur->next; // record the remaining list after bifurcation node
cur->next = flatten(cur->down); // flatten lower level list
cur->down = NULL; // flatten bifurcation node
while (cur->next) { // find the new tail after flatten and set down to NULL
cur->down = NULL;
cur = cur->next;
}
cur->next = nxt; // attach tail to the remaining list
return head;
}
```