```
class Solution(object):
def rotate(self, m):
"""
:type matrix: List[List[int]]
:rtype: void Do not return anything, modify matrix in-place instead.
"""
n = len(m)
for i in xrange(n / 2):
for j in xrange((n+1) / 2):
m[i][j], m[j][~i], m[~i][~j], m[~j][i] = m[~j][i], m[i][j], m[j][~i], m[~i][~j]
```

For those of you who don't know about ~, try it out yourself :)