Pergunta de entrevista da empresa Talkwalker

find longest substring palindrome of given string i.e. "ababaza" answer: "ababa"