Pergunta de entrevista da empresa MANTL

Technical question involving strings / arrays.