Pergunta de entrevista da empresa Publicis Sapient

Some coding round i got stuck .. almost based on strings