```
func convertBST(root *TreeNode) *TreeNode {
node, _ := traverse(root, 0)
return node
}
func traverse(root *TreeNode, sum int) (*TreeNode, int){
if root == nil {
return nil, sum
}
_, sum = traverse(root.Right, sum)
root.Val += sum
sum = root.Val
_, sum = traverse(root.Left, sum)
return root, sum
}
```