An efficient algorithm for stochastic optimal control problems by means of a least-squares Monte-Carlo method. (2nd November 2022)