A Newton-like algorithm to compute the inverse of a nonlinear map that converges in finite time