Leetcode PHP题解--D53 566. Reshape the Matrix

D53 566. Reshape the Matrix

题目链接

566. Reshape the Matrix

题目分析

给定一个二维数组,将它重新排列成rc列的二维数组。

思路

先把数据全部提出来,再用array_chunk函数重新分割数组。

最终代码

若觉得本文章对你有用,欢迎用爱发电资助。

你可能感兴趣的:(Leetcode PHP题解--D53 566. Reshape the Matrix)