[leetCode刷题笔记]566. Reshape the Matrix
来源:互联网 发布:淘宝联盟购物 编辑:程序博客网 时间:2024/06/05 17:50
public class Solution { public int[][] matrixReshape(int[][] nums, int r, int c) { if (nums == null || nums.length == 0 || r * c != nums.length * nums[0].length) return nums; int[][] result = new int[r][c]; int k = 0; for (int i = 0; i < nums.length; i++ ) { for (int j = 0; j < nums.length; j++) { result[k / c][k % c] = nums[i][j]; k++; } } return result; }}
阅读全文
0 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
- Maven 常用配置注释
- 前后端分离的j2ee的web项目设计,怎么判断用户是否登录?
- [Android] 任意时刻从子线程切换到主线程的实现原理及加强版
- C++ 静态 常量
- 怎么样才能进入BAT公司的研发部门
- [leetCode刷题笔记]566. Reshape the Matrix
- Android点击其他区域,隐藏EditText键盘。
- pygame.music
- PHP接入umeditor(百度富文本编辑器)
- linux设备树笔记
- 在SQL SERVER里面用命令查包含某字段的表
- Mybatis错误
- https请求的过程图
- Android开发推荐 [记录]