Solution Free: --- Sheldon M Ross Stochastic Process 2nd Edition

Mean Time Spent in Transient States. Solution Strategy: Use the fundamental matrix $\mathbfM = (\mathbfI - \mathbfQ)^-1$, where $\mathbfQ$ is the submatrix of the transition matrix corresponding to transient states. The entry $m_ij$ represents the expected time the chain spends in state $j$ given it started in state $i$.

The 2nd edition introduced several updates that are reflected in modern solution sets: --- Sheldon M Ross Stochastic Process 2nd Edition Solution

The holy grail of difficulty. Problem 6.18 (the reflection principle applied to maximum of Brownian motion) is frequently assigned as a take-home exam. A complete solution requires a diagrammatic argument plus the use of the Markov property at the stopping time. Mean Time Spent in Transient States