Ad
# 90 degrees clockwise matrix rotate
def rotate(m):
    return list(zip(*m))[::-1]