ShopBack interview question

Palindromic subsequence in finding the inputted substring