title: logic behind printing this pattern
body: <pre><code>4 4 4 4 4 4 4  
  4 3 3 3 3 3 4   
  4 3 2 2 2 3 4   
  4 3 2 1 2 3 4   
  4 3 2 2 2 3 4   
  4 3 3 3 3 3 4   
  4 4 4 4 4 4 4  
  </code></pre>
  <p>we have to make a program for above pattern</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() 
  {
  
      int n;
      scanf(&quot;%d&quot;, &amp;n);
      int len = n*2 - 1;
      for(int i=0;i&lt;len;i++){
          for(int j=0;j&lt;len;j++){
              int min = i &lt; j ? i : j;
              min = min &lt; len-i ? min : len-i-1;
              min = min &lt; len-j-1 ? min : len-j-1;
               printf(&quot;%d &quot;, n-min);
          }
          printf(&quot;\n&quot;);
      }
  return 0;
  }
  </code></pre>
  <p>this is the code to print the above pattern I am getting what is the main logic behind these codes I am trying to debug and trace this code. I need help, especially in these lines</p>
  <pre><code>int min = i &lt; j ? i : j;
  min = min &lt; len-i ? min : len-i-1;
  min = min &lt; len-j-1 ? min : len-j-1;
  </code></pre>