def trimBST(root: Optional[TreeNode], low: int, high: int) -> Optional[TreeNode]:
def helper(root, low, high):
if not root:
return(root)
if root.val < low:
return(helper(root.right, low, high))
elif root.val > high:
return(helper(root.left, low, high))
else:
root.left = helper(root.left, low, high)
root.right = helper(root.right, low, high)
return(root)
return(helper(root, low, high))