title: write a function called steps() that builds a square staircase for any n
body: <p>I am new to R and trying to figure out how to solve this problem.
  write a function called steps() that builds a square staircase for any n.<br>
  <img src="https://i.stack.imgur.com/uOZuX.png" alt="enter image description here"></p>
  
  <p>this is what I have initially</p>
  
  <pre><code>steps&lt;- function(n)
  
  {
    mx &lt;- matrix(,nrow=n,ncol = n)
  
    for( n in 1:n)
    {
      mx[n,n] = "#"
  
  
    }
  
    print(mx)
  }
  </code></pre>