Python ✅✅✅ || Faster than 97.71% || Memory beats 96.95%
Code\n### Credits: qiy2019, jiny2019\n\nclass Solution:\n    def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:\n        newMatrix = []\n 
# Code\n### Credits: qiy2019, jiny2019\n```\nclass Solution:\n    def flipAndInvertImage(self, image: List[List[int]]) -> List[List[int]]:\n        newMatrix = []\n        for row in image:\n            reversedRow = reversed(row)\n            newRow = []\n            for item in reversedRow:\n                if item == 1: newRow.append(0)\n                else: newRow.append(1)\n            newMatrix.append(newRow)\n        return newMatrix\n```\n\n![image.png](https://assets.leetcode.com/users/images/17175a9a-d48f-4d01-9aeb-36bf77483609_1669957888.1098146.png)\n![image.png](https://assets.leetcode.com/users/images/dfbc41cb-730c-4fda-8934-f44032149a83_1669957915.5076413.png)\n
['Python3']