728x90
728x90
[Java] 59.Spiral Matrix II - LeetCode Daily Challenge
코딩테스트/leetcode2023. 5. 10. 21:15[Java] 59.Spiral Matrix II - LeetCode Daily Challenge

https://leetcode.com/problems/spiral-matrix-ii/ Spiral Matrix II - LeetCode Can you solve this real interview question? 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: [https://assets.leetcode.com/uploads/2020/11/13/spiraln.jpg] Input: n = 3 O leetcode.com 풀이 방향에 대한 변수와, 한 칸씩 체크해줄 변수를 지정해 준 뒤, 카운팅만 잘 해주면 되는 문제였..

728x90
728x90
image