C++ Super Simple, Short and Clean Iterative Solution, 4ms O(n) TC O(1) SC
\nclass Solution {\npublic:\n    Node* flatten(Node* head) {\n        Node *ptr = head, *tmp_next, *runner;\n        \n        while (ptr) {\n            if (pt
```\nclass Solution {\npublic:\n    Node* flatten(Node* head) {\n        Node *ptr = head, *tmp_next, *runner;\n        \n        while (ptr) {\n            if (ptr->child) {\n                \n                // Save the current next and connect the child to next\n                tmp_next = ptr->next;\n                ptr->next = ptr->child;\n                ptr->next->prev = ptr;\n                ptr->child = NULL;\n                \n                // Run till the end of the current list and connect last node to saved next\n                runner = ptr->next;\n                while (runner->next) runner = runner->next;\n                runner->next = tmp_next;\n                if (runner->next) runner->next->prev = runner;\n            }\n            \n            ptr = ptr->next;\n        }\n        \n        return head;\n    }\n};\n```\n**Like it? please upvote!**
['C']