```
#zip(*matrix [::-1]) :Rotate the matrix by 90 degrees (clockwise).
def generateMatrix(self, n):
def gen(l, w, b): #Generate a l*w Matrix. the begin number is b.
return l * [[]] and [range(b, b+l)] + zip(*gen(w-1, l, b+l)[::-1])
return gen(n, n, 1)
```