DoorDash interview question

LC hard Tree sum max