IncredibleThings

导航

2018年5月20日 #

LeetCode - Evaluate Reverse Polish Notation

摘要: 用 stack 完美契合 阅读全文

posted @ 2018-05-20 22:44 IncredibleThings 阅读(89) 评论(0) 推荐(0) 编辑

LeetCode - Reverse Words in a String II

摘要: Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters. The input string does not contain lea 阅读全文

posted @ 2018-05-20 10:44 IncredibleThings 阅读(103) 评论(0) 推荐(0) 编辑

LeetCode - Rotate Array

摘要: Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 2: Note: Try to come up as many solutions as you 阅读全文

posted @ 2018-05-20 08:08 IncredibleThings 阅读(91) 评论(0) 推荐(0) 编辑

LeetCode - Spiral Matrix II

摘要: Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3 Output: [ [ 1, 2, 3 ], [ 8, 阅读全文

posted @ 2018-05-20 02:39 IncredibleThings 阅读(82) 评论(0) 推荐(0) 编辑

LeetCode - Spiral Matrix

摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Example 2: 复杂度 时间 O(NM) 空间 O(1) 思路 阅读全文

posted @ 2018-05-20 00:48 IncredibleThings 阅读(115) 评论(0) 推荐(0) 编辑