摘要:
解法一: 思想:计下每一个0元素的行列,放在集合中,然后集合转数组,(直接放数组也行,感觉自己有点多余,原本想减少数组实例的内存,但是也增加了对象。得不偿失吧,两者的空间复制度都是一样);然后更具对应的数组的行列,将其变为0 public class SetZeroTest { public sta 阅读全文
posted @ 2021-11-04 11:09
樱花颂
阅读(160)
评论(0)
推荐(0)
摘要:
图解: 代码解决: public class RotateTest { public static void main(String[] args) { Integer[][] matrix = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 1 阅读全文
posted @ 2021-11-04 09:48
樱花颂
阅读(159)
评论(0)
推荐(0)

浙公网安备 33010602011771号