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
When execution: 44 ms, beat the 73.88% of all users to submit in python
Memory consumption: 11.8 MB, defeated 14.29% of all users to submit in python
——2019.10.29