leetcode——832. 翻转图像

class Solution(object):
    def flipAndInvertImage(self, A):
        """
        :type A: List[List[int]]
        :rtype: List[List[int]]
        """
        for i in range(len(A)):
            A[i]=A[i][::-1]
            for j in range(len(A[i])):
                A[i][j]=1-A[i][j]
        return A
执行用时 :44 ms, 在所有 python 提交中击败了73.88%的用户
内存消耗 :11.8 MB, 在所有 python 提交中击败了14.29%的用户
 
——2019.10.29
posted @ 2019-10-29 20:45  欣姐姐  阅读(106)  评论(0编辑  收藏  举报