Pregunta de entrevista de Neustar

String question with optimized solution.