Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 353 Bytes

Flipping an Image.md

File metadata and controls

17 lines (12 loc) · 353 Bytes

Question Link

https://leetcode.com/problems/flipping-an-image/

Approach

Python Code

class Solution:
    def flipAndInvertImage(self, A: List[List[int]]) -> List[List[int]]:
        for index, row in enumerate(A):
            A[index] = [0 if pixel else 1 for pixel in row[::-1]]
        return A
            

Code Explanation