2015年4月20日

摘要: Title:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the l... 阅读全文
posted @ 2015-04-20 11:08 月下之风 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Title: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not 阅读全文
posted @ 2015-04-20 11:03 月下之风 阅读(151) 评论(0) 推荐(0) 编辑

2015年4月16日

摘要: Title: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 思路就是每次以两倍增长除数,知道即将大于被除数,然后用被除数减 阅读全文
posted @ 2015-04-16 09:57 月下之风 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Title: Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 当用char*的时候的一些操作,不要和string的弄混了.还有 阅读全文
posted @ 2015-04-16 09:04 月下之风 阅读(149) 评论(0) 推荐(0) 编辑

2015年4月15日

摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l 阅读全文
posted @ 2015-04-15 15:37 月下之风 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Title: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 排好序的,然后merge,很容易让人联想到归并排序。可以将k个序列按照二分进行分割,然后 阅读全文
posted @ 2015-04-15 08:46 月下之风 阅读(255) 评论(0) 推荐(0) 编辑

2015年4月14日

摘要: Title: https://leetcode.com/problems/generate-parentheses/ Given n pairs of parentheses, write a function to generate all combinations of well-formed 阅读全文
posted @ 2015-04-14 14:54 月下之风 阅读(128) 评论(0) 推荐(0) 编辑

2015年4月13日

摘要: Title: Given a linked list, remove the nth node from the end of list and return its head. For example, class Solution {public: ListNode *removeNthFrom 阅读全文
posted @ 2015-04-13 09:12 月下之风 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Title: https://leetcode.com/problems/letter-combinations-of-a-phone-number/ Given a digit string, return all possible letter combinations that the num 阅读全文
posted @ 2015-04-13 09:08 月下之风 阅读(191) 评论(0) 推荐(0) 编辑

2015年4月12日

摘要: int a[] = {2,3,4,5,10}; int n = 5; vector coll(a,a+n); sort(coll.begin(), coll.end(), greater()); //copy(coll.begin(), coll.end(), ostream... 阅读全文
posted @ 2015-04-12 22:29 月下之风 阅读(280) 评论(0) 推荐(0) 编辑

导航