Pregunta de entrevista de Accenture

Asked about strings questions. Easy leet code