I would petition to add a reasonable machine accuracy margin to the final large test. Out of 4000 elements, my result differed from the correct answer in 134 elements with a maximum difference of < 1E-12!! Especially when going to the effort of making a properly vectorized solution avoiding arrayfun() and other "cheats" for this strict problem.
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: United States.
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.