Find max distance between alive tree nodes | DoorDash Interview Question