Given the root of a BST
root and a key key. Delete the node with value key and return the root of the updated tree.Example 1
Input: root = [0], key = 0
Output: null
Explanation: Deleting the only node.
Output: null
Explanation: Deleting the only node.
Example 2
Input: root = [5,3,6,2,4,null,7], key = 3
Output: [5,4,6,2,null,null,7]
Explanation: Deleting a node with two children.
Output: [5,4,6,2,null,null,7]
Explanation: Deleting a node with two children.