We use the Rydberg formula for the wavelength of spectral lines in the hydrogen atom:
$\frac{1}{\lambda} = R_H \left(\frac{1}{n_f^2} - \frac{1}{n_i^2}\right)$.
Case (i): Transition from $n_i=4$ to $n_f=2$. The wavelength is $\lambda_1$.
$\frac{1}{\lambda_1} = R_H \left(\frac{1}{2^2} - \frac{1}{4^2}\right) = R_H \left(\frac{1}{4} - \frac{1}{16}\right) = R_H \left(\frac{4-1}{16}\right) = \frac{3R_H}{16}$.
So, $\lambda_1 = \frac{16}{3R_H}$.
Case (ii): Transition from $n_i=3$ to $n_f=1$. The wavelength is $\lambda_2$.
$\frac{1}{\lambda_2} = R_H \left(\frac{1}{1^2} - \frac{1}{3^2}\right) = R_H \left(1 - \frac{1}{9}\right) = R_H \left(\frac{8}{9}\right) = \frac{8R_H}{9}$.
So, $\lambda_2 = \frac{9}{8R_H}$.
Now, we calculate the difference $(\lambda_1 - \lambda_2)$.
$\lambda_1 - \lambda_2 = \frac{16}{3R_H} - \frac{9}{8R_H} = \frac{1}{R_H} \left(\frac{16}{3} - \frac{9}{8}\right)$.
To subtract the fractions, we find a common denominator, which is 24.
$\lambda_1 - \lambda_2 = \frac{1}{R_H} \left(\frac{16 \times 8 - 9 \times 3}{24}\right) = \frac{1}{R_H} \left(\frac{128 - 27}{24}\right) = \frac{1}{R_H} \left(\frac{101}{24}\right)$.
The wavelengths $\lambda_1$ and $\lambda_2$ are given in Angstroms (\AA{}), but the Rydberg formula with $R_H$ in cm$^{-1}$ gives $\lambda$ in cm. The question asks for the difference in cm. Since the calculation is done in terms of $1/R_H$, the unit is automatically handled.