832. 翻转图像
思路
顾名思就是把一个二维数组每一行都倒序,然后黑白色颠倒(二值图像吗,就是0变1,1变0),
代码
class Solution:
def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:
ans=[]
for i in image:
ans.append(list(map(lambda x:1-x,i[::-1])))
return ans