Pregunta de entrevista de Amazon

two algorithm s are about the string