今際の国の呵呵君
Sunday, November 5, 2017
[LeetCode]Spiral Matrix
从里到外一层一层剥洋葱即可,注意最后只剩一行或者一列的时候不要重复访问。时间复杂度O(n),空间复杂度O(1),代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment