Pergunta de entrevista da empresa monday.com

I was asked to implement a string manipulation function