0ms || 100% FASTER || JAVA CODE
\nclass Solution {\n    public Node connect(Node root) {\n        if(root == null) return null;\n        Node left = root.left;\n        Node right = root.right
```\nclass Solution {\n    public Node connect(Node root) {\n        if(root == null) return null;\n        Node left = root.left;\n        Node right = root.right;\n        while(left != null){\n            left.next = right;\n            left = left.right;\n            right = right.left;\n        }\n        connect(root.left);\n        connect(root.right);\n        return root;  \n    }\n}\n```
['Java']