NOT 2^n. O(n^2) + O(p^2) where n is length of string and p is number of palindromes
\n/*\n\tO(n^2) + O(plogp) where p is number of palindromes\n\n\tAlgorithm: for each posible palindrome starting charactera look at each possible palindrome end 
```\n/*\n\tO(n^2) + O(plogp) where p is number of palindromes\n\n\tAlgorithm: for each posible palindrome starting charactera look at each possible palindrome end character, and if valid, add it\'s length and mask of bits, set corresponding to which positions were used by the palindrome, to a list of palindromes \n\n\tThen sort the list from longest to shortest palindrome and check to see which two, lengths multiplied together, are the maximum value.\n\n*/\nvar maxProduct = function(s) {\n    let seen = [];\n    function dfs(lo, hi, len, used) {\n        for (let i = lo; i < hi; ++i) {\n            for (let j = hi; j >= i; --j) {\n                if (s[i] === s[j]) {\n                    if (i === j) {\n                        if (len > 0) {\n                            seen.push([len + 1, used | (1 << i)]);\n                        }\n                    } else if (i === j - 1) {\n                        seen.push([len + 2, used | (1 << i) | (1 << j)]);\n                    } else if (i === j - 2) {\n                        seen.push([len + 3, used | (1 << i) | (1 << j) | (1 << (i + 1))]);       \n                        seen.push([len + 2, used | (1 << i) | (1 << j)]);  \n                    } else {\n                        seen.push([len + 2, used | (1 << i) | (1 << j)]);                          \n                        dfs(i + 1, j - 1, len + 2, used | (1 << i) | (1 << j));\n                    }\n                } else if (len > 0) {\n                    seen.push([len + 1, used | (1 << j)]);\n                }\n            }\n        }\n    }\n    for (let i = 0; i < s.length; ++i) {\n        seen.push([1, 1 << i]);\n    }\n    dfs(0, s.length - 1, 0, 0);\n    seen.sort( (a,b) => b[0] - a[0] );\n    let ans = 1;\n    for (let i = 0; i < seen.length; ++i) {\n        for (let j = i + 1; j < seen.length; ++j) {\n            if ((seen[i][1] & seen[j][1]) === 0) {\n                let num = seen[i][0] * seen[j][0];\n                if (num < ans) {\n                    break;\n                }\n                ans = num;\n            }\n        }\n    }\n    return ans;\n};\n\n```
[]