Inverse Sturm-Liouville problems with two discontinuities