The houses form a binary tree, and each node holds some money. If two directly linked houses (a parent and its child) are robbed on the same night, the police are called. Return the maximum amount that can be robbed without that happening.
- You may rob any set of houses in which no two are parent and child
- An empty tree gives
0 - A recursion that re-explores grandchildren is exponential; aim for O(n)
build(arr) turns a level-order array (with null for a missing child) into a tree, and toArray(root) turns a tree back into one.