题目
思想
这道题有太多的方法可以实现。递归,for循环等等。下面就用while循环来解决这道题。
抽象一下这道题,发现其实就是将这个矩阵往四个方向的遍历,按照的顺序是 右 =>下 => 左 => 上 => 右 => … 需要分一下循环边界即可。
代码
这道题有太多的方法可以实现。递归,for循环等等。下面就用while循环来解决这道题。
抽象一下这道题,发现其实就是将这个矩阵往四个方向的遍历,按照的顺序是 右 =>下 => 左 => 上 => 右 => … 需要分一下循环边界即可。
【LeetCode】39. 组合总和
【代码】剑指 Offer 29. 顺时针打印矩阵。
顺时针打印矩阵(十九)题目描述
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M