For this Question: Write a program to print a butterfly pattern of row size 2n,  where the value of n is given by the user.Integer n represents half the row size of the pattern
<b>User Task:</b>
Since this is a functional problem you don't have to worry about taking input, you just have to complete the function <b>butterflyPattern()</b> and print the output.

<b>Constraint</b>
n<=100

Output is a butterfly pattern in 2n rows.<b>Input</b>
4

<b>Output</b>
<pre>*      *
**    **
***  ***
********
********
***  ***
**    **
*      * </Pre>, I have written this Solution Code: class Solution {
   
    public void butterflyPattern(int N) {
        for(int i=1;i<=N;i++)  
        {  
             for(int j=1 ;j<=i;j++)  
             {  
                  System.out.print("*");  
             }  
             for(int j=1 ;j<=2*(N-i);j++)  
             {  
                  System.out.print(" ");  
             }  
             for(int j=1 ;j<=i;j++)  
             {  
                  System.out.print("*");  
             }  
             System.out.println();  
        }  
        for(int i=N;i>0;i--)  
        {  
             for(int j=1 ;j<=i;j++)  
             {  
                  System.out.print("*");  
             }  
             for(int j=1 ;j<=2*(N-i);j++)  
             {  
                  System.out.print(" ");  
             }  
             for(int j=1 ;j<=i;j++)  
             {  
                  System.out.print("*");  
             }  
             System.out.println();     
        }
} 
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?