LeetCode 솔루션 분류
59. Spiral Matrix II
본문
[ Leetcode 시즌 3 ] 2022년도 4월 12일 문제 입니다.
[ Medium ] 59. Spiral Matrix II
Given a positive integer n
, generate an n x n
matrix
filled with elements from 1
to n2
in spiral order.
Example 1:
Input: n = 3 Output: [[1,2,3],[8,9,4],[7,6,5]]
Example 2:
Input: n = 1 Output: [[1]]
Constraints:
1 <= n <= 20
관련자료
-
링크
댓글 2
mingki님의 댓글
- 익명
- 작성일
C++
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Spiral Matrix II.
Memory Usage: 6.7 MB, less than 18.13% of C++ online submissions for Spiral Matrix II.
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Spiral Matrix II.
Memory Usage: 6.7 MB, less than 18.13% of C++ online submissions for Spiral Matrix II.
bobkim님의 댓글
- 익명
- 작성일
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Spiral Matrix II.
Memory Usage: 6.4 MB, less than 87.54% of C++ online submissions for Spiral Matrix II.
Memory Usage: 6.4 MB, less than 87.54% of C++ online submissions for Spiral Matrix II.