Short and clear python code
class Solution:\n    # @param root, a tree node\n    # @return a list of lists of integers\n    def zigzagLevelOrder(self, root):\n        queue = collections.d
    class Solution:\n    # @param root, a tree node\n    # @return a list of lists of integers\n    def zigzagLevelOrder(self, root):\n        queue = collections.deque([root])\n        res = []\n        while queue:\n            r = []\n            for _ in range(len(queue)):\n                q = queue.popleft()\n                if q:\n                    r.append(q.val)\n                    queue.append(q.left)\n                    queue.append(q.right)\n            r = r[::-1] if len(res) % 2 else r\n            if r:\n                res.append(r)\n        return res
['Python']