编程语言
首页 > 编程语言> > 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

标签:832,python,image,List,len,int,range,LeetCode
来源: https://blog.csdn.net/jilli_jelly/article/details/123148110