Tap here to switch tabs
Problem
Submissions

Problem: Maximum Product of Two Palindromic Substring Lengths

Try to solve the Maximum Product of the Length of Two Palindromic Substrings problem.

Statement

You are given a 00 indexed string s. You need to choose two disjoint palindromic substrings of odd length from s such that the product of their lengths is maximized.

Return the maximum possible product of the lengths of the two substrings.

Note: A substring is a contiguous sequence of characters within a string. A string is palindromic if it reads the same forward and backward. Two substrings are disjoint if they do not share any indices.

Constraints:

  • 2≤2 \leq s.length ≤105\leq 10^5

  • s consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Product of Two Palindromic Substring Lengths

Try to solve the Maximum Product of the Length of Two Palindromic Substrings problem.

Statement

You are given a 00 indexed string s. You need to choose two disjoint palindromic substrings of odd length from s such that the product of their lengths is maximized.

Return the maximum possible product of the lengths of the two substrings.

Note: A substring is a contiguous sequence of characters within a string. A string is palindromic if it reads the same forward and backward. Two substrings are disjoint if they do not share any indices.

Constraints:

  • 2≤2 \leq s.length ≤105\leq 10^5

  • s consists of lowercase English letters.