Pergunta de entrevista da empresa MathWorks

OA: minimum spanning tree Technical round: a question about arranging a string into a palindrome, with the ability to replace some characters