码迷,mamicode.com
首页 > 其他好文 > 详细

leetcode——832. 翻转图像

时间:2019-10-29 21:48:39      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:内存   ima   span   elf   return   pre   code   color   lis   

class Solution(object):
    def flipAndInvertImage(self, A):
        """
        :type A: List[List[int]]
        :rtype: List[List[int]]
        """
        for i in range(len(A)):
            A[i]=A[i][::-1]
            for j in range(len(A[i])):
                A[i][j]=1-A[i][j]
        return A
执行用时 :44 ms, 在所有 python 提交中击败了73.88%的用户
内存消耗 :11.8 MB, 在所有 python 提交中击败了14.29%的用户
 
——2019.10.29

leetcode——832. 翻转图像

标签:内存   ima   span   elf   return   pre   code   color   lis   

原文地址:https://www.cnblogs.com/taoyuxin/p/11761453.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!