6.15 二刷hot100 普通数组
This commit is contained in:
parent
46a9f57fb2
commit
af0416096f
@ -1,6 +1,5 @@
|
||||
package matrix;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题目:59. 螺旋矩阵 II (generateMatrix)
|
||||
@ -13,6 +12,7 @@ import java.util.List;
|
||||
|
||||
* 链接:https://leetcode.cn/problems/spiral-matrix-ii/
|
||||
*/
|
||||
//二刷会做,同54题一个思路
|
||||
public class GenerateMatrix {
|
||||
public int[][] generateMatrix(int n) {
|
||||
int[][]res=new int[n][n];
|
||||
|
@ -16,6 +16,7 @@ import java.util.List;
|
||||
输出:[1,2,3,4,8,12,11,10,9,5,6,7]
|
||||
*/
|
||||
//没想出
|
||||
//二刷会做
|
||||
public class SpiralOrder {
|
||||
public List<Integer> spiralOrder(int[][] matrix) {
|
||||
List<Integer> result = new ArrayList<>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user