影子喵喵喵

关注

LeetCode|832. 翻转图像(python)

影子喵喵喵

关注

阅读 69

2022-02-26

题目:
在这里插入图片描述
代码:

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 832. 翻转图像

残北 74 0 0

RockYoungTalk

Leetcode 832. 翻转图像(可以,一次过)

RockYoungTalk 59 0 0

目标践行者

832. 翻转图像 【每日一题】

目标践行者 80 0 0

静守幸福

【坚持每日一题5.23】832. 翻转图像

静守幸福 67 0 0

浮游图灵

Python图像处理丨图像缩放、旋转、翻转与图像平移

浮游图灵 85 0 0

诗远

如何在OpenCV Python中翻转图像?

诗远 73 0 0

星巢文化

LeetCode题解(0493):翻转对(Python)

星巢文化 44 0 0

凛冬已至夏日未远

LeetCode题解(0822):翻转卡片游戏(Python)

凛冬已至夏日未远 53 0 0

whiteMu

LeetCode题解(0293):翻转游戏(Python)

whiteMu 33 0 0

就是耍帅

【LeetCode】整数翻转

就是耍帅 41 0 0

精彩评论(0)

0 0 举报