https://leetcode.com/problems/kth-smallest-element-in-a-bst


Success

___

Runtime
56 ms
Beats
79.75%

Memory
17.9 MB
Beats
99.34%

___

```python
class Solution:
    def kthSmallest(self, root: Optional[TreeNode], k: int) -> int:
        # 2023/1/7 6:44
        self.values = []
        def travel(node):
            if node:
                self.values.append(node.val)
                travel(node.left)
                travel(node.right)
        travel(root)
        self.values.sort()
        return self.values[k-1]
        # 2023/1/7 6:46
```
