input: Write a function to create a spiral matrix of size n.
  assert createSpiralMatrix(3) == [[1, 2, 3], [8, 9, 4], [7, 6, 5]]
  assert createSpiralMatrix(4) == [[1, 2, 3, 4], [12, 13, 14, 5], [11, 16, 15, 6], [10, 9, 8, 7]]
  assert createSpiralMatrix(2) == [[1, 2], [4, 3]]
output: def createSpiralMatrix(n):
      matrix = [[0] * n for _ in range(n)]
      num = 1
      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
  
          if top <= bottom:
              for i in range(right, left - 1, -1):
                  matrix[bottom][i] = num
                  num += 1
              bottom -= 1
  
          if left <= right:
              for i in range(bottom, top - 1, -1):
                  matrix[i][left] = num
                  num += 1
              left += 1
  
      return matrix