Pregunta de entrevista de Tesla

String based question and data structure question.