NeetCode #463LC-1325MediumTreesNC 250
← Back to All Problems#463 · #1325 · Delete Leaves With a Given Value(删除给定值的叶子节点)
📌 Problem Statement & Constraints
Given the root of a binary tree and an integer
target, repeatedly delete all leaf nodes with value target until no more such leaves exist. Return the root. Constraints: the number of nodes is in [1, 3000], 1 <= Node.val, target <= 1000.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!