Fastenal India interview question

diamond problem in oops. longest palindromic substring