NeetCode #451LC-337MediumTreesNC 250
← Back to All Problems

#451 · #337 · House Robber III(打家劫舍 III)

📌 Problem Statement & Constraints

A thief plans to rob houses arranged in a binary tree. Adjacent houses (parent and child) cannot both be robbed. Return the maximum amount that can be robbed. Constraints: the number of nodes is in [1, 10^4], 0 <= Node.val <= 10^4.
🔒

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!