Longest Common Palindromic Substring Leetcode Javascript