We’re preparing your current view and syncing the latest data.
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node of the BST after deletion.
Basically, the deletion can be divided into two stages:
Note: The deletion process involves three main cases:
Return the root node of the BST after deleting the node with the given key, serialized in the same format as the input.