input: Write a python function to generate a spiral matrix.
  assert generate_spiral_matrix(3) == [
      [0, 1, 2],
      [7, 8, 3],
      [6, 5, 4]
  ]
  assert generate_spiral_matrix(4) == [
      [0, 1, 2, 3],
      [11, 12, 13, 4],
      [10, 15, 14, 5],
      [9, 8, 7, 6]
  ]
  assert generate_spiral_matrix(2) == [
      [0, 1],
      [3, 2]
  ]
output: def generate_spiral_matrix(n):
      if n <= 0:
          return []
  
      matrix = [[0] * n for _ in range(n)]
      num = 0
      left, right = 0, n - 1
      top, bottom = 0, n - 1
  
      while left <= right and top <= bottom:
          for i in range(left, right + 1):
              matrix[top][i] = num
              num += 1
          top += 1
  
          for i in range(top, bottom + 1):
              matrix[i][right] = num
              num += 1
          right -= 1
  
          for i in range(right, left - 1, -1):
              matrix[bottom][i] = num
              num += 1
          bottom -= 1
  
          for i in range(bottom, top - 1, -1):
              matrix[i][left] = num
              num += 1
          left += 1
  
      return matrix