Question: Please it must be done and comment it in python launguage . Thank you 2. You are given a matrix, which needs to be horizontally
2. You are given a matrix, which needs to be horizontally flipped and inverted. Flipping the matrix horizontally means each row is reversed. Example, row [ 1 00] would be flipped to [0011 Then you need to invert the matrix i.e. replace 0 by 1 and 1 by O Write a function for the above task Do not use numpy or pandas for this question. Example: Example 1: Input: [[1,1,0],(1,0,1],[e,e,e]] output: [[1,e,0], [e,1,e],11,1,1]1 Explanation: First reverse each row: [re,1,1],(1,0,1].[e,e,e11 Then, invert the image: [[1,e,e1,[e,1,e],[1,1,1]1 Example 2: Input: [[1,1,e,0],[1,e,0,1],(0,1,1,1],(1,0,1,011 Output: [[1,1,0,0],[e, 1, 1,0],[,0,,1],[1,0,1,0]]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
