MCPcopy Create free account
hub / github.com/LjyYano/LeetCode / L0059_SpiralMatrixII

Class L0059_SpiralMatrixII

src/main/java/L0059_SpiralMatrixII.java:17–97  ·  view source on GitHub ↗

https://leetcode.cn/problems/spiral-matrix-ii/ 给你一个正整数 n ,生成一个包含 1 到 n² 所有元素,且元素按顺时针顺序螺旋排列的 n x n 正方形矩阵 matrix 。 示例 1: 输入:n = 3 输出:[[1,2,3],[8,9,4],[7,6,5]] 示例 2: 输入:n = 1 输出:[[1]] 提示: 1 <= n <= 20

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected