- 博客(10)
- 收藏
- 关注
转载 【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 240
转载 【Leetcode】Rotate Image
【题目】 You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). 【思路】 The idea was firstly transpose the matrix and then flip it symmetrically.
2015-08-26 14:31:59 251
转载 【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 278
转载 【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 335
转载 【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 284
转载 【Leetcode】Combination sum 1,2
【题目】 【分析】 首先,先sort, 如果target > 0: 【代码】 using recursive 这恐怕的 O(n2)... 过程: before recursion : [2] before recursion : [2, 2] before recursion : [2, 2, 2] after recursion and remove :
2015-08-24 16:47:10 335
转载 【Leetcode】Search for a range
【题目】 【思路】 The problem can be simply broken down as two binary searches for the begining and end of the range, respectively: First let's find the left boundary of the range. We ini
2015-08-23 21:09:39 270
转载 【Eclipse】Eclipse快捷键总结
Eclipse中10个最有用的快捷键组合 一个Eclipse骨灰级开发者总结了他认为最有用但又不太为人所知的快捷键组合。通过这些组合可以更加容易的浏览源代码,使得整体的开发效率和质量得到提升。 1. ctrl+shift+r:打开资源 这可能是所有快捷键组合中最省时间的了。这组快捷键可以让你打开你的工作区中任何一个文件,而你只需要按下文件名或mask名中的前几个字母,比如a
2015-08-13 16:33:20 326
转载 【Leetcode】Largest Number
【题目】 Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result may
2015-08-03 21:38:34 272
转载 【Leetcode】Reorder List
【题目】 Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example, Given {1,2,3,4}, reorder it
2015-08-03 20:21:03 254
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人