easy BFS Python 🐍 solution
\n\nclass Solution:\n    def connect(self, root: \'Node\') -> \'Node\':\n        \n        if not root:\n            return None\n        \n        q=collection
```\n\nclass Solution:\n    def connect(self, root: \'Node\') -> \'Node\':\n        \n        if not root:\n            return None\n        \n        q=collections.deque()\n        \n        q.append(root)\n        \n        while q:\n            for i in range(1,len(q)):\n                q[i-1].next=q[i]\n            q[-1].next=None    \n            newLevel=deque()\n            for node in q:\n                if node.left:\n                    newLevel.append(node.left)\n                if node.right:\n                    newLevel.append(node.right)\n                    \n            q=newLevel\n        return root\n```
['Python', 'Python3']