Flatten Multi-Level Linked List

You are given a multilevel linked list where each node has a next pointer and a child pointer. The list is flattened by expanding all child lists into the main list.

Given the head of the multilevel linked list, return the flattened list.

Examples
Input: [1,2,3,4,5]
Output: [1,2,3,4,5]
Hints

Flatten Multi-Level Linked List

You are given a multilevel linked list where each node has a `next` pointer and a `child` pointer. The list is flattened by expanding all child lists into the main list.