摘要: 316. Remove Duplicate Letters321. Create Maximum Number402. Remove K Digits这三道题都用到了 stack 来求原序列中不打乱相对次序的最小子序列的技巧: 阅读全文
posted @ 2017-07-08 21:53 apanda009 阅读(157) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/u014688145/article/details/72859739 阅读全文
posted @ 2017-07-08 17:43 apanda009 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The 阅读全文
posted @ 2017-07-08 16:30 apanda009 阅读(130) 评论(0) 推荐(0) 编辑
摘要: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2017-07-08 15:40 apanda009 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm th 阅读全文
posted @ 2017-07-08 13:40 apanda009 阅读(277) 评论(0) 推荐(0) 编辑
摘要: Given a nested list of integers represented as a string, implement a parser to deserialize it. Each element is either an integer, or a list -- whose e 阅读全文
posted @ 2017-07-06 17:07 apanda009 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2017-07-06 15:08 apanda009 阅读(113) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/evaluate-reverse-polish-notation/#/description RPN中文名字叫做逆波兰表示法,它的好处维基百科说了,就是不需要括号来表示运算的先后,直接根据式子本身就可以求解。解题思路就是维护一个栈,遇到数字 阅读全文
posted @ 2017-07-05 22:13 apanda009 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 这两题有一个 trick 和 Minimum Window Substring 非常像,就是维护一个 "curCount" 代表目前 (i,j) 之间 match 上的数量,而通过 hash[] 的正负充当计数器的作用 参照 k characters: http://www.cnblogs.com/ 阅读全文
posted @ 2017-07-05 21:50 apanda009 阅读(143) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/linked-list-cycle-ii/#/description 阅读全文
posted @ 2017-07-05 20:09 apanda009 阅读(127) 评论(0) 推荐(0) 编辑