Delete Node in a BST
MediumLeetCodeAdvanced Trees (BST, LCA, Tree DP)
Approach hintTry it first, then revealHide
Find the key using the BST order. A node with at most one child is replaced by that child; otherwise copy in the in-order successor's value and delete the successor from the right subtree.