Compute time to burn tree | Tesla Interview Question