Diagonalization of the transfer matrix of a nonintersecting string model