For this Question: Given an integer n, your task is to print the pattern as shown in example:-
For n=5, the pattern is:
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>pattern_making()</b> that takes the integer n as parameter.

Constraints:-
1 <= n <= 100Print the pattern as shown.Sample Input:-
5

Sample output:-
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1

Sample Input:-
2

Sample Output:-
1
1 2 1
1, I have written this Solution Code:        public static void pattern_making(int n){
          for(int i=1;i<=n;i++){
    for(int j=1;j<=i;j++){
        System.out.print(j+" ");
    }
    for(int j=i-1;j>=1;j--){
        
        System.out.print(j+" ");
    }
        System.out.println();
}

for(int i=n-1;i>=1;i--){
    for(int j=1;j<=i;j++){
        
        System.out.print(j+" ");
    }
    for(int j=i-1;j>=1;j--){
        
        System.out.print(j+" ");
    }
    
        System.out.println();
}
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?