- 博客(8)
- 收藏
- 关注
原创 LeetCode:Reorder List
Given a singly linked listL: 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}, r
2014-05-29 22:21:47 1035
原创 LeetCode:4Sum
Given an array S of n integers, are there elementsa, b, c, and d in S such that a +b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:
2014-05-27 16:45:41 907
原创 LeetCode:Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i
2014-05-25 19:43:30 822
原创 LeetCode: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 exact
2014-05-24 00:51:59 1100 1
原创 LeetCode:3Sum
题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements
2014-05-22 19:01:23 766
原创 LeetCode:Two Sum
题目: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up t
2014-05-20 14:58:44 832
原创 LeetCode:Single Number II
题目: Given an array of integers, every element appearsthree times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implem
2014-05-19 23:14:25 1038
原创 POJ 3171
题目大意: 给定一个区间范围[M,E],接下来有n行输入,每行输入三个数值:T1,T2,S,表示覆盖区间[T1,T2]的代价为S,要求你求出覆盖区间[M,E]的最小代价,如果不能覆盖,则输出-1.解题思路: 先将区间按右端点进行排序,这样我们就能得到dp状态的定义和转移方程: dp[i
2014-05-19 00:29:57 2017
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人