首页 > 其他 > 详细

832. 翻转图像

时间:2020-04-29 10:09:46      阅读:57      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 技术分享图片

技术分享图片

 

 技术分享图片

 

 

 1 class Solution(object):
 2     def flipAndInvertImage(self, A):
 3         """
 4         :type A: List[List[int]]
 5         :rtype: List[List[int]]
 6         """
 7         for i in range(len(A)):
 8             temp = A[i][::-1]
 9             for j in range(len(temp)):
10                 temp[j] = 0 if temp[j] == 1 else 1
11             A[i] = temp
12         return A
13 
14 if __name__ == __main__:
15     solution = Solution()
16     print(solution.flipAndInvertImage([[1, 1, 0], [1, 0, 1], [0, 0, 0]]))

 

832. 翻转图像

原文:https://www.cnblogs.com/panweiwei/p/12800161.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!