Google | Phone | House Robber III
Anonymous User
2097

Find max sum of elements in a Binary Tree, such that you don't select the adjuscent nodes.
If node contains all negative numbers then return 0.

For example if the given root Node is like this:

		3
		/\
	-1    15
	/ \   / \
 8   1    0  2

Then the valid max tree is 15 + 8 + 1 = 24

my solution:

Also read my onsite round experience: Google Onsite Mountain View

Comments (6)