Parse 2D array in matrix form and apply your operations.