Right-to-Left BFS (Python + Java)
Doing BFS right-to-left means we can simply return the last node's value and don't have to keep track of the first node in the current row or even care about ro
Doing BFS right-to-left means we can simply return the **last** node's value and don't have to keep track of the first node in the current row or even care about rows at all. Inspired by @fallcreek's solution (not published) which uses two nested loops to go row by row but already had the right-to-left idea making it easier. I just took that further.\n\n**Python:**\n\n    def findLeftMostNode(self, root):\n        queue = [root]\n        for node in queue:\n            queue += filter(None, (node.right, node.left))\n        return node.val\n\n**Java:**\n\n    public int findLeftMostNode(TreeNode root) {\n        Queue<TreeNode> queue = new LinkedList<>();\n        queue.add(root);\n        while (!queue.isEmpty()) {\n            root = queue.poll();\n            if (root.right != null)\n                queue.add(root.right);\n            if (root.left != null)\n                queue.add(root.left);\n        }\n        return root.val;\n    }
[]