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:  function patternMaking(N)
  {
    
       for(let j=1; j <= 2*N - 1; j++) {

        let k;
        if(j<= N) {
            k = j;
        } else {
            k = 2*N - j;
        }
        
        let res = "";
        for(let i=1; i<=2*k-1; i++) {
            if(i<=k) {
                res += i + " ";
            } else {
                res += 2*k - i + " ";
            }
        }
          console.log(res);
    }
  
  }, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?