Numerical technique for the inverse resonance problem