Pregunta de entrevista de Turing

2 DSA question about strings.