![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Array
WayneShan
这个作者很懒,什么都没留下…
展开
-
【LeetCode】【JAVA】【045】Find Minimum in Rotated Sorted Array II
题目: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 5 6 7 0 1 2).Find the minimum element.The array may contain duplicates.原创 2015-02-22 03:24:09 · 103 阅读 · 0 评论 -
【LeetCode】【JAVA】【061】Length of Last Word
题目:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is原创 2015-03-24 11:31:14 · 184 阅读 · 0 评论 -
【LeetCode】【JAVA】【066】Search for a Range
题目:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found原创 2015-03-26 08:33:05 · 109 阅读 · 0 评论 -
【LeetCode】【JAVA】【051】Merge Sorted Array
题目:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional element原创 2015-02-24 07:20:11 · 204 阅读 · 0 评论 -
【LeetCode】【JAVA】【053】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原创 2015-02-24 09:02:20 · 150 阅读 · 0 评论 -
【LeetCode】【JAVA】【041】Search in Rotated Sorted Array II
题目:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target is in th原创 2015-02-21 01:06:56 · 131 阅读 · 0 评论 -
【LeetCode】【JAVA】【046】Remove Duplicates from Sorted Array II
题目:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is now [1,1原创 2015-02-22 07:27:00 · 124 阅读 · 0 评论 -
【LeetCode】【JAVA】【044】Plus One
题目:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.思路:貌似没有什么原创 2015-02-22 02:59:09 · 120 阅读 · 0 评论 -
【LeetCode】【JAVA】【040】Search 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 5 6 7 0 1 2).You are given a target value to search. If found in the array return原创 2015-02-21 00:24:34 · 128 阅读 · 0 评论 -
【LeetCode】【JAVA】【076】3Sum Closest
题目:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have ex原创 2015-04-03 08:43:46 · 155 阅读 · 0 评论