| 57 | # self.right = None |
| 58 | |
| 59 | class Solution: |
| 60 | |
| 61 | def find_data(self, root: TreeNode): |
| 62 | |
| 63 | if root is None: |
| 64 | return |
| 65 | Solution.find_data(self,root.left) |
| 66 | self.data.append(root.val) |
| 67 | Solution.find_data(self,root.right) |
| 68 | return |
| 69 | |
| 70 | def kthSmallest(self, root: TreeNode, k: int) -> int: |
| 71 | self.data = [] |
| 72 | Solution.find_data(self, root) |
| 73 | return self.data[k-1] |
nothing calls this directly
no outgoing calls
no test coverage detected