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

猜你喜欢

转载自www.cnblogs.com/taoyuxin/p/11761453.html