Boundary Of Binary Tree, is a LeetCode problem. In this post we will see how we can solve this challenge in Python

Problem Description

Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and right boundary in order without duplicate nodes.

Left boundary is defined as the path from root to the left-most node. Right boundary is defined as the path from root to the right-most node. If the root doesn't have left subtree or right subtree, the ....

You can find the full details of the problem Boundary of Binary Tree at LeetCode

Solution: Please check the main.py snippet for the solution.

This solution originally posted at: Github by @kamyu104