Pregunta de entrevista de Google

Simple starter but increases difficulty in improving an algorithm