Define a helper function that takes a node as an argument and returns an array of two integers.
If the node is null, return [0, 0] as the base case.
Recursively call the helper function for the left and right children of the current node.
Calculate the money robbed when not robbing the current node by summing the maximum values of the left and right children's recursive calls.
Calculate the money robbed when robbing the current node by adding the current node's value to the sum of the values when not robbing the left and right children.
Return an array where the first element is the maximum money robbed when not robbing the current node, and the second element is the maximum money robbed when robbing the current node.
In the main function, call the helper function with the root node and return the maximum of the two values in the returned array.