LeetCode|832. 翻转图像(python)

题目:
LeetCode|832. 翻转图像(python)
代码:

class Solution:
    def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:
        for i in range(len(image)):
            image[i]=image[i][::-1]
            for j in range(len(image[i])):
                if image[i][j]==1:
                    image[i][j]-=1
                else:
                    image[i][j]+=1
        return image
上一篇:LeetCode 0009 Palindrome Number


下一篇:Leetcode 525. 连续数组