Pregunta de entrevista de Synaptics

Algorithms for Array sorry and was asked to optimize for memory & speed