Hard
文章平均质量分 73
ljffdream
这个作者很懒,什么都没留下…
展开
-
[Leetcode]Median of two sorted array
[题目] There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). [分析] [code转载 2015-06-11 09:59:15 · 608 阅读 · 0 评论 -
【Leetcode】Largest Ractangular
【题目】 Largest Rectangle in Histogram Total Accepted: 42804 Total Submissions: 188970My Submissions Question Solution Given n non-negative integers representing the histogram转载 2015-09-02 11:02:12 · 284 阅读 · 0 评论 -
【Leetcode】Merge intervals
【题目】 Given a collection ofintervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. 【思路】 思路就是,先对进来的这一个list 的inteval进行比较,排序,排序的时候转载 2015-08-31 22:31:50 · 249 阅读 · 0 评论 -
【Leetcode】Jump Game 1,2
【题目】 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. You转载 2015-08-26 10:27:45 · 288 阅读 · 0 评论 -
【Leetcode】Rain trapping
【题目】 Given n non-negative integers representing anelevation map where the width of each bar is 1, compute how much water it isable to trap after raining. For example, Given [0,1,0,2,1,0,1,3,2,1转载 2015-08-25 22:18:54 · 344 阅读 · 0 评论 -
【Leetcode】First Missing Positive
【题目】 Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and us转载 2015-08-24 23:21:41 · 291 阅读 · 0 评论 -
【Leetcode】Merge K Sorted Linked List
【题目】 Merge k sorted Linked Lists and return it as one sorted lists. Analyze and describe its complexity . 【思路】 leetcode clean book 【代码】 private static final Comparator listComparator = new转载 2015-07-16 21:39:48 · 357 阅读 · 0 评论 -
[Leetcode]Sorted in rotated Array 2
[题目] median 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 tar转载 2015-06-12 09:13:22 · 299 阅读 · 0 评论 -
【LeetCode】Find Minimum In Rotated Sorted Array 1 and 2
【题目】 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. You may assume no duplicate转载 2015-01-05 10:20:39 · 294 阅读 · 0 评论 -
【Leetcode】maximum Rangtangle in 2D matrix
【题目】 Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area. 【思路】 只能说不明觉厉: The DP solution proceeds row by row, starting f转载 2015-09-02 11:10:29 · 314 阅读 · 0 评论