python 3 short solution, O(mr), 88ms (97%)
\nclass Solution:\n    def matrixReshape(self, nums: List[List[int]], r: int, c: int) -> List[List[int]]:\n        #\n        m = len(nums); n = len(nums[0])\n 
```\nclass Solution:\n    def matrixReshape(self, nums: List[List[int]], r: int, c: int) -> List[List[int]]:\n        #\n        m = len(nums); n = len(nums[0])\n        if m*n != r*c: return nums\n        flattern = []\n        for i in range(m):\n            flattern += nums[i]\n        return [flattern[i*c:i*c+c] for i in range(r)]\n```\n![image](https://assets.leetcode.com/users/images/f3f47eb7-f938-4e92-8422-05ac72983c47_1609102643.755119.png)\n
['Python', 'Python3']