An algorithm for computing minimum norm solutions of finite moment problem