Optimal Monte Carlo Methods for $$L^2$$L2-Approximation