Day 23 二叉树 - 修剪二叉搜索树
669. 修剪二叉搜索树
function trimBST(root: TreeNode | null, low: number, high: number): TreeNode | null {
if (root === null) {
return null;
}
if (root.val > high) {
return trimBST(root.left, low, high);
}
if (root.val <...
youngle316.hashnode.dev1 min read