8-liner Python
\nclass Solution(object):\n    def zigzagLevelOrder(self, root):\n        """\n        :type root: TreeNode\n        :rtype: List[List[int]]\n        """\n     
```\nclass Solution(object):\n    def zigzagLevelOrder(self, root):\n        """\n        :type root: TreeNode\n        :rtype: List[List[int]]\n        """\n        if not root:\n            return []\n        res, level, direction = [], [root], 1\n        while level:\n            res.append([n.val for n in level][::direction])\n            direction *= -1\n            level = [kid for node in level for kid in (node.left, node.right) if kid]\n        return res\n```
[]