Easy Java Solution, 100% faster and takes 0ms  and  O(1) space
\npublic Node flatten(Node head) {\n        if(head==null) return head;\n        Node curr = head;\n        \n        while(curr!=null){\n            if(curr.ch
```\npublic Node flatten(Node head) {\n        if(head==null) return head;\n        Node curr = head;\n        \n        while(curr!=null){\n            if(curr.child!=null){\n                Node down =  curr.child;\n                while(down.next!=null) down = down.next;\n                Node temp = curr.next;\n                curr.next = curr.child;\n                curr.child.prev = curr;\n                curr.child= null;\n                down.next = temp;\n                if(temp!=null) temp.prev = down;\n            }\n            curr = curr.next;\n        }\n        return head;\n    }\n\n```
[]