Python sol by recursion. 80%+ [w/ Visualization ]
Python sol by recursion\n\n---\n\nIllustration and Visualization:\n\n\n\n---\n\nImplemetation by recursion\n\n\nclass Solution:\n    def flatten(self, head: \'N
Python sol by recursion\n\n---\n\n**Illustration and Visualization**:\n\n![image](https://assets.leetcode.com/users/brianchiang_tw/image_1590152207.png)\n\n---\n\n**Implemetation** by recursion\n\n```\nclass Solution:\n    def flatten(self, head: \'Node\') -> \'Node\':\n        \n        def helper(head) -> \'None\':\n            \n            prev, current_node = None, head\n            \n            while current_node:\n                \n                if current_node.child:\n                    \n                    # flatten child linked list\n                    current_child, current_tail = current_node.child, helper(current_node.child)\n                    \n                    # After next level flattening is completed\n                    # Handle for the concatenation between current linked list and child linked list\n                    \n                    # current node\'s child points to None after flattening\n                    current_node.child = None\n                    \n                    ## Update the linkage between original next and current tail                    \n                    original_next = current_node.next\n                    \n                    if original_next: \n                        original_next.prev = current_tail                    \n                    \n                    current_tail.next = original_next\n                            \n                    ## Update the linkage between current node and current child\n                    current_node.next, current_child.prev = current_child, current_node\n                    \n                    # update prev and cur, move to next position\n                    prev, current_node = current_tail, original_next\n                    \n                    \n                else:\n                    \n                    # update prev and cur, move to next position\n                    prev, current_node = current_node, current_node.next\n            \n            \n            # return tail node\n            return prev\n        \n\t# ------------------------------------------------------------------------------\n\n        helper(head)\n        \n        return head\n```
['Recursion', 'Python', 'Python3']