You are given an m x n matrix mat and two integers r and c. Reshape mat into a new r x c matrix that holds the same values in the same row-major order: read mat row by row, left to right, and fill the new matrix row by row in that order.
If an r x c matrix cannot hold exactly the same number of values (m * n != r * c), return the original mat unchanged.