Leetcode 861 Solution
This article provides solution to leetcode question 861 (flipping-an-image)
Access this page by simply typing in "lcs 861" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/flipping-an-image
Solution
class Solution(object):
def flipAndInvertImage(self, A):
"""
:type A: List[List[int]]
:rtype: List[List[int]]
"""
for i, row in enumerate(A):
A[i] = reversed(row)
for i, row in enumerate(A):
A[i] = [1 - val for val in A[i]]
return A