- 博客(8)
- 收藏
- 关注
原创 栈的问题
对于栈一类的问题,个人感觉可能会很“复杂”,但是不会是特别“难于理解”,解题的时候一定要把过程想得很清楚。 leetcode值得刷的题 1. 复杂过程仔细分析的 42. Trapping Rain Water 84. Largest Rectangle in Histogram 超级相似的两道题,不过水这个因为有连续性可以用双指针,最大直方图还是要老老实实用栈来做,其核心思路是如...
2019-03-17 00:37:46 403
原创 239. Sliding Window Maximum
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window m...
2019-03-17 00:36:30 186
原创 155. Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top() – Get the ...
2019-03-17 00:35:54 177
原创 316. Remove Duplicate Letters
Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order a...
2019-03-17 00:35:15 218
原创 239. Sliding Window Maximum
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window m...
2019-03-17 00:34:04 218
原创 84. Largest Rectangle in Histogram
Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. Above is a histogram where width of each b...
2019-03-17 00:32:50 178
原创 42. Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], ret...
2019-03-17 00:31:07 166
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人