上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: Example 3: 解题思路:Suppose you are at pair 0,0 (index 0 and index 0, not value), which is the current minimum.Then you know the only two possible followe 阅读全文
posted @ 2017-04-09 20:26 Tsunami_lj 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 转自:http://lhearen.top/2016/08/27/Sort-for-Built-in-Containers/ C ++中有很多内置的容器,我们可以轻松有效地实现我们想要的内容。 然而,有时它们的排序能力相对有限,因此,我们必须提出自定义比较器来重新定义排序功能。 几乎所有的函数/容器 阅读全文
posted @ 2017-04-08 16:38 Tsunami_lj 阅读(130) 评论(0) 推荐(0) 编辑
摘要: TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文
posted @ 2017-04-07 15:41 Tsunami_lj 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values 阅读全文
posted @ 2017-04-07 11:37 Tsunami_lj 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2017-04-06 20:36 Tsunami_lj 阅读(82) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2017-04-06 15:40 Tsunami_lj 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example,Given n = 3, You should return the followi 阅读全文
posted @ 2017-04-06 14:31 Tsunami_lj 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = "aabcc",s2 = "dbbca", When s3 = "aadbbcbcac", ret 阅读全文
posted @ 2017-04-06 12:01 Tsunami_lj 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 解题思路:蛮暴力的枚举,主要的难点在于如何处理重复点。 这个是错误的解法:主要是错在k的枚举起点,因 阅读全文
posted @ 2017-04-05 17:05 Tsunami_lj 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc 阅读全文
posted @ 2017-04-04 18:41 Tsunami_lj 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页