
leetcode
cyywxy
这个作者很懒,什么都没留下…
展开
-
LeetCode-11~Container with Most Water
转自:https://www.jianshu.com/p/23e8e3e53abfGiven n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of l...转载 2018-02-27 11:14:58 · 144 阅读 · 0 评论 -
LeetCode 39 Combination Sum(满足求和等于target的所有组合)
转自:https://www.cnblogs.com/zpfbuaa/p/6537720.html题目链接: https://leetcode.com/problems/combination-sum/?tab=Description Problem: 给定数组并且给定一个target,求出所有满足求和等于target的数字组合 遍历所有的数组中元素,然后对target进行更新,将该元素添加到te...转载 2018-04-11 15:17:53 · 675 阅读 · 0 评论 -
[LeetCode] 55. Jump Game Java
转自:https://www.cnblogs.com/271934Liao/p/7053406.html题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents转载 2018-03-29 18:11:04 · 194 阅读 · 0 评论 -
LeetCode 53. Maximum Subarray(最大的子数组)
转自:https://www.cnblogs.com/jimmycheng/p/7204034.htmlFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2...转载 2018-03-23 15:58:12 · 144 阅读 · 0 评论 -
leetcode169 Majority Element
转自:https://www.jianshu.com/p/c7691d8f68f8题目给定一个整型数组,找出主元素,它在数组中的出现次数严格大于数组元素个数的二分之一。样例给出数组[1,1,1,1,2,2,2],返回 1分析方法一 voting,最重要的一个方法较为简单,遍历一遍记录次数就可以了。这种方法的思想是把 majority element 看成是 1,转载 2018-03-19 16:24:28 · 145 阅读 · 0 评论 -
【leetcode】53. Maximum Subarray 连续子序列的最大和
转自:https://segmentfault.com/a/11900000073566381. 题目Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given th转载 2018-03-19 01:04:42 · 206 阅读 · 0 评论 -
leetcode34
转自:https://segmentfault.com/a/1190000009241523思路一 二分法初级运用最初的思路是使用二分法找到目标值的其中一个下标,再根据该下标左右遍历得出初始下标和结束下标。 public int[] searchRange(int[] nums, int target) { int[] result = new int[]{-1, -1};...转载 2018-03-16 13:59:47 · 155 阅读 · 0 评论 -
leetcode33
转自:http://blog.youkuaiyun.com/sunnyyoona/article/details/18313497Search in Rotated Sorted Array Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 ...转载 2018-03-16 11:45:48 · 236 阅读 · 0 评论 -
LeetCode 14 : Longest Common Prefix (Java)
转自:http://blog.youkuaiyun.com/changetocs/article/details/50165781 标签:String 解题思...转载 2018-02-27 19:57:52 · 118 阅读 · 0 评论 -
leetcode46. Permutations
转自:https://blog.youkuaiyun.com/rxt2012kc/article/details/6046994246. PermutationsGiven a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations...转载 2018-04-13 17:15:45 · 149 阅读 · 0 评论