LeetCode * 566.Reshape the Matrix
来源:互联网 发布:旅游沙盘教学软件 编辑:程序博客网 时间:2024/06/06 09:24
class Solution {public: vector<vector<int>> matrixReshape(vector<vector<int>>& nums, int r, int c) { int m = nums.size(), n = nums[0].size(), o = m * n; if (r * c != o) return nums; vector<vector<int>> res(r, vector<int>(c, 0)); for (int i = 0; i < o; i++) res[i / c][i % c] = nums[i / n][i % n]; return res; }};
阅读全文
1 0
- leetcode 566. Reshape the Matrix
- LeetCode 566. Reshape the Matrix
- [LeetCode]566. Reshape the Matrix
- [leetcode]566. Reshape the Matrix
- LeetCode:566. Reshape the Matrix
- leetcode 566. Reshape the Matrix
- LeetCode | 566. Reshape the Matrix
- leetcode-566. Reshape the Matrix
- LeetCode 566.Reshape the Matrix
- LeetCode: 566. Reshape the Matrix
- LeetCode-566. Reshape the Matrix
- LeetCode * 566.Reshape the Matrix
- LeetCode: 566. Reshape the Matrix
- leetcode.566.Reshape the Matrix
- LeetCode 566. Reshape the Matrix
- [LeetCode] 566. Reshape the Matrix
- 【LeetCode】566. Reshape the Matrix
- [LeetCode]566. Reshape the Matrix
- 集成kafka和flume
- leetcode566. Reshape the Matrix
- Camera Tuning?
- jquery的一些常见的问题
- c primer plus 阅读共享 -2
- LeetCode * 566.Reshape the Matrix
- kafka中server.properties说明
- 内存管理
- mysql执行外部sql文件的命令
- MapReduce Job本地提交过程源码跟踪及分析
- 126 C语言格式化读写文件
- connect研究
- springboot解决跨域问题
- android SharedPreferences 读写 及 工具类介绍