Pergunta de entrevista da empresa Citi

Given a string with "?", return a palindrome if possible. EX: ?ab?b returns babab