Unable to decode logic of this pattern : <p>I want to print a pattern, when the user input a no. 'N' it will print a pattern like below with all the outer arms of the pattern will contain 'N' '-'. </p>

<pre><code>    /\
   /  \
  / /\ \
 / /  \ \
   \ \  / /
    \ \/ /
     \  /
      \/
</code></pre>

<p>I have tried a lot to decode, but i am unable to decode, i did tried few things.
If someone help me or guide me with this logic, it will be great help.</p>

<pre><code>int num=4;
int input = num*2;
String[][] arr = new String[input][input];

for (int i = 0; i &lt; input; i++) {
    for (int j = 0; j &lt; input; j++) {
        if (j+1== num - i) {
            arr[i][j] = "/";
            System.out.print(arr[i][j]);
        } else if (j + 1 == num + i + 1) {
            arr[i][j] = "\\";
            System.out.print(arr[i][j]);
        } else {
            arr[i][j] = "-";
            System.out.print(arr[i][j]);
        }
    }
    System.out.println();
}
</code></pre>
