Given the root of a binary search tree and an integer key, remove the node with value key from the tree, and return the root of the updated binary search tree.
The deletion consists of two main stages:key.
Constraints:
The number of nodes in the tree is in the range
Node.val
Each node has a unique value.
root is a valid binary search tree.
key
Given the root of a binary search tree and an integer key, remove the node with value key from the tree, and return the root of the updated binary search tree.
The deletion consists of two main stages:key.
Constraints:
The number of nodes in the tree is in the range
Node.val
Each node has a unique value.
root is a valid binary search tree.
key