python - reshape matrix

  • 0
    class Solution(object):
        def matrixReshape(self, nums, r, c):
            :type nums: List[List[int]]
            :type r: int
            :type c: int
            :rtype: List[List[int]]
            numlist = []
            for row in nums:
                numlist += row
            if len(numlist) < r*c:
                return nums
            newnums = []
            for i in range(r):
                newrow = []
                for j in range(c):
            return newnums

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.