Pregunta de entrevista de Metron Labs

About the given task, how you approach the code, optimisation.