leetcode 832 Flipping an Image(反转图像) python3 最简代码(一行代码)

class Solution:
    def flipAndInvertImage(self, A):
        """
        :type A: List[List[int]]
        :rtype: List[List[int]]
        """
        return [list(map(lambda x , y : x ^ y, row[::-1] , len(row)*[1]))  for row in A] 




猜你喜欢

转载自blog.csdn.net/huhehaotechangsha/article/details/80543179