For this Question: Given a string A. The only operation allowed is to insert characters at the beginning of the string.
Find how many minimum characters are needed to be inserted to make the string a palindrome string.
Note: Strings are to be considered case sensitive.Input contains a single line string.

Constraints:
1 ≤ S ≤ 400Output the minimum characters that are needed to be inserted to make the string a palindrome string.Input 1:
ABC

Output 1:
 2
    
Explanation 1:
Insert 'B' at beginning, string becomes: "BABC".
Insert 'C' at beginning, string becomes: "CBABC"., I have written this Solution Code: import java.io.*;
import java.util.*;



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

        int count = 0;
        int flag = 0;

        while (str.length() > 0)
		{
            if (ispalindrome(str))
			{
                flag = 1;
                break;
            } else
			{
                count++;
                str = str.substring(0, str.length() - 1);
            }
        }
        if (flag == 1) {
            System.out.println(count);
        }
    }

	 static boolean ispalindrome(String s)
	 {
        int l = s.length();

        for (int i = 0, j = l - 1; i <= j; i++, j--)
		{
            if (s.charAt(i) != s.charAt(j))
                return false;
        }
        return true;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?