For this Question: Given a string of length N. You have to select two non- overlapping (no common index) non- empty substrings of odd lengths from that string such that both those substrings are palindrome. You want the product of lengths of those substring to be maximum.Input contains of a single String of length N.

Constraints
2 <= N <= 100000
String contains lowercase english letters.Print a single integer which is the maximum possible product of lengths of selected substrings.Sample input 1
aabaaba

Sample output 1
9

Explanation : we can select substring [2-4] = aba and [5-7] = aba the product of their lengths is 9.

Sample Input 2
aabababaaa

Sample Output 2
15
, I have written this Solution Code: import java.io.*;
import java.util.*;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;



class Main {
	public static void main (String[] args)
    throws IOException
    {
        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        String str = read.readLine();
			System.out.println(maxProduct(str));

	}
   public static long maxProduct(String str) {
        StringBuilder sb = new StringBuilder(str);
        int x = sb.length();
        int[] dpl = new int[x];
        int[] dpr = new int[x];
        modifiedOddManacher(sb.toString(), dpl);
        modifiedOddManacher(sb.reverse().toString(), dpr);
        long max=1;
        for(int i=0;i<x-1;i++)
            max=Math.max(max, (1+(dpl[i]-1)*2L)*(1+(dpr[x-(i+1)-1]-1)*2L));
        return max;
    }
    private static void modifiedOddManacher(String str, int[] dp){
        int x = str.length();
        int[] center = new int[x];
        for(int l=0,r=-1,i=0;i<x;i++){
            int radius = (i > r) ? 1 : Math.min(center[l+(r-i)], r-i+1);
               while(i-radius>=0 && i+radius<x && str.charAt(i-radius)==str.charAt(i+radius)) {
                  dp[i+radius] = radius+1;
                  radius++;
               }
            center[i] = radius--;
            if(i+radius>r){
                l = i-radius;
                r = i+radius;
            }
        }
        for(int i=0, max=1;i<x;i++){
            max = Math.max(max, dp[i]);
            dp[i] = max;
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?