comefrom: <doocs>0059.Spiral Matrix II_1.py
code: def generateMatrix( n: int) -> List[List[int]]:
      res = [[0] * n for _ in range(n)]
      num = 1
      m1, m2 = 0, n - 1
      while m1 < m2:
          for j in range(m1, m2):
              res[m1][j] = num
              num += 1
          for i in range(m1, m2):
              res[i][m2] = num
              num += 1
          for j in range(m2, m1, -1):
              res[m2][j] = num
              num += 1
          for i in range(m2, m1, -1):
              res[i][m1] = num
              num += 1
          m1 += 1
          m2 -= 1
      if m1 == m2:
          res[m1][m1] = num
      return res
masked: def sample_funcname ( var_0 : int ) -> List [ List [ int ] ] :
      var_2 = [ [ 0 ] * var_0 for var_1 in range ( var_0 ) ]
      var_3 = 1
      var_4 , var_5 = 0 , var_0 - 1
      while var_4 < var_5 :
          for var_6 in range ( var_4 , var_5 ) :
              var_2 [ var_4 ] [ var_6 ] = var_3
              var_3 += 1
          for var_7 in range ( var_4 , var_5 ) :
              var_2 [ var_7 ] [ var_5 ] = var_3
              var_3 += 1
          for var_6 in range ( var_5 , var_4 , - 1 ) :
              var_2 [ var_5 ] [ var_6 ] = var_3
              var_3 += 1
          for var_7 in range ( var_5 , var_4 , - 1 ) :
              var_2 [ var_7 ] [ var_4 ] = var_3
              var_3 += 1
          var_4 += 1
          var_5 -= 1
      if var_4 == var_5 :
          var_2 [ var_4 ] [ var_4 ] = var_3
      return var_2
  