2196. Create Binary Tree From Descriptions
## 思路
用HashTable纪录Node
## Complexity
Time, Space: O(N)
## Code
```python
class Solution:
def createBinaryTree(self, descriptions: List[List[int]]) ->
Optional[TreeNode]:
mapping = {}
children = set()
for parent, child, is_left in descriptions:
children.add(child)
if child not in mapping:
mapping[child] = TreeNode(child)
if parent not in mapping:
mapping[parent] = TreeNode(parent)
if is_left:
mapping[parent].left = mapping[child]
else:
mapping[parent].right = mapping[child]
for key, node in mapping.items():
if key not in children:
return node
return None
```