![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
cainiaozjz
这个作者很懒,什么都没留下…
展开
-
leetcode 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 ea...原创 2018-11-23 22:04:47 · 86 阅读 · 0 评论 -
leetcode 98. Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The ...原创 2018-11-25 09:43:18 · 95 阅读 · 0 评论 -
leetcode 15. 3Sum
这是一个寻找Mr/Mrs.Right的故事。 先排序便于搜索。 先 fix 一个数, 寻找另外两个匹配的数。 用两个指针 丈夫和妻子。 丈夫尺寸为 fix 的下一个数。妻子的尺寸为最后一个数, 他们的目的是合起来等于第 fix 个数的相反数。 丈夫可以变大,妻子可以缩小。(通过某种手术,咳咳……) 他们的初始和偏大,因为丈夫指向开头,所以无法变小,只能妻子变小为能和丈夫match的尺寸...原创 2019-02-18 17:35:47 · 78 阅读 · 0 评论