Advertisement
kucheasysa

Algoverse_adesh_27

Jun 24th, 2024
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. class Solution:
  2.     def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:
  3.         for i in range(len(image)):
  4.             image[i] = image[i][::-1]
  5.             for j in range(len(image[i])):
  6.                 if image[i][j] == 0:
  7.                     image[i][j] = 1
  8.                 else:
  9.                     image[i][j] = 0
  10.         return image
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement