Pregunta de entrevista de monday.com

I was asked to implement a string manipulation function