上一页 1 ··· 4 5 6 7 8 9 10 11 下一页

2014年3月11日

Combination Sum

摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated number may be chosen fromCunlimited number of times.Note:All numbers (including target) will be positive integers.Elements in a combination (a1,a2, … ,ak 阅读全文

posted @ 2014-03-11 19:39 pengyu2003 阅读(109) 评论(0) 推荐(0) 编辑

2014年3月10日

Substring with Concatenation of All Words

摘要: You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.For example, given:S:"barfoothefoobarman"L:["foo", " 阅读全文

posted @ 2014-03-10 19:46 pengyu2003 阅读(157) 评论(0) 推荐(0) 编辑

Merge k Sorted Lists

摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.学习并练习 priority_queue.priority_queue的几个重要函数 push pop top./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * };... 阅读全文

posted @ 2014-03-10 15:42 pengyu2003 阅读(110) 评论(0) 推荐(0) 编辑

2014年3月8日

Generate Parentheses

摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"class Solution {public: vector generateParenthesis(int n) { 阅读全文

posted @ 2014-03-08 11:26 pengyu2003 阅读(100) 评论(0) 推荐(0) 编辑

2014年3月7日

3-7

摘要: 刷题相对容易,弄明白一道题或者刷对几道题,非常有成就感,并不浪费时间。看书很麻烦,可能看了一整天也没有感觉什么收获。不过不看书积累好多题没地方下手啊……这周题刷的很少,大神们都是2-3天刷个70-80道,我这都两周才不到40道。慢慢来吧,书必须要看啊! 阅读全文

posted @ 2014-03-07 20:41 pengyu2003 阅读(96) 评论(0) 推荐(0) 编辑

4sum

摘要: Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of target.Note:Elements in a quadruplet (a,b,c,d) must be in non-descending order. (ie,a≤b≤c≤d)The solution set must not contain duplicate quadruplets. . 阅读全文

posted @ 2014-03-07 15:42 pengyu2003 阅读(138) 评论(0) 推荐(0) 编辑

Letter Combinations of a Phone Number

摘要: Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit string "23"Output: ["ad", "ae", "af", "bd", "be", &q 阅读全文

posted @ 2014-03-07 14:44 pengyu2003 阅读(125) 评论(0) 推荐(0) 编辑

3Sum Closest

摘要: Given an arraySofnintegers, find three integers inSsuch 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 exactly one solution. For example, given array S = {-1 2 1 -4}, and target = 1. The sum that is closest to ... 阅读全文

posted @ 2014-03-07 11:03 pengyu2003 阅读(128) 评论(0) 推荐(0) 编辑

2014年3月6日

3Sum

摘要: Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c) must be in non-descending order. (ie,a≤b≤c)The solution set must not contain duplicate triplets. For example, given array S... 阅读全文

posted @ 2014-03-06 21:27 pengyu2003 阅读(189) 评论(0) 推荐(0) 编辑

2014年3月5日

3-5

摘要: 开始刷难度为3的题,明显感觉题的复杂度上升。如果不仔细思考,很难找到时间和空间都较优的解。除此之外,题本身也更需要思考理解。金典的非题部分水过了一遍,下一阶段主要刷leetcode和金典的题。多见题、多刷题才能熟练。看着自己干干瘪瘪的简历,感觉自己这么长时间都白读了。赶紧发论文吧……还好不是现在就找工作,没填满的简历还可以去填新的东西。感谢和我一起拼搏的兄弟们,向我提供帮助的哥们们,我们一起努力! 阅读全文

posted @ 2014-03-05 22:23 pengyu2003 阅读(108) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 下一页

导航