#450 - Delete Node in a BST
Given the root of a BST and a key, delete the node with that key and return the root of the modified BST. The tree must remain a valid BST after deletion.
| Input | Output |
|---|---|
root = [5,3,6,2,4,null,7], key = 3 | [5,4,6,2,null,null,7] |
root = [5,3,6,2,4,null,7], key = 0 | [5,3,6,2,4,null,7] |
root = [], key = 0 | [] |