29. 顺时针旋转数组

顺时针打印矩阵

http://www.nowcoder.com/questionTerminal/9b4c81a02cd34f76be2659fa0d54342a

class Solution:
    # matrix类型为二维列表,需要返回列表
    def printMatrix(self, matrix):
        # write code here
        a = []
        while matrix:
            for j in range(len(matrix[0])):
                a.append(matrix[0][j])
            matrix = list(map(list,zip(*matrix[1:])))[::-1]
        return a
全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 11:55
点赞 评论 收藏
分享
07-01 13:37
门头沟学院 Java
steelhead:不是你的问题,这是社会的问题。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务