上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 43 下一页

2016年4月30日

1. Two Sum

摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文

posted @ 2016-04-30 07:38 joannae 阅读(156) 评论(0) 推荐(0) 编辑

2016年4月24日

22. Generate Parentheses (backTracking)

摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: " 阅读全文

posted @ 2016-04-24 06:51 joannae 阅读(250) 评论(0) 推荐(0) 编辑

2016年4月18日

21. Merge Two Sorted Lists

摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 阅读全文

posted @ 2016-04-18 07:36 joannae 阅读(140) 评论(0) 推荐(0) 编辑

2016年4月17日

20. Valid Parentheses (Stack)

摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文

posted @ 2016-04-17 18:05 joannae 阅读(209) 评论(0) 推荐(0) 编辑

19. Remove Nth Node From End of List

摘要: Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After rem 阅读全文

posted @ 2016-04-17 12:10 joannae 阅读(145) 评论(0) 推荐(0) 编辑

18. 4Sum (通用算法 nSum)

摘要: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic 阅读全文

posted @ 2016-04-17 11:56 joannae 阅读(388) 评论(0) 推荐(0) 编辑

2016年4月16日

17. Letter Combinations of a Phone Number (backtracking)

摘要: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文

posted @ 2016-04-16 15:32 joannae 阅读(209) 评论(0) 推荐(0) 编辑

2016年4月14日

16. 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. 阅读全文

posted @ 2016-04-14 22:32 joannae 阅读(177) 评论(0) 推荐(0) 编辑

15. 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 阅读全文

posted @ 2016-04-14 22:02 joannae 阅读(248) 评论(0) 推荐(0) 编辑

2016年4月13日

14. Longest Common Prefix (截取字符串)

摘要: Write a function to find the longest common prefix string amongst an array of strings. 阅读全文

posted @ 2016-04-13 19:22 joannae 阅读(198) 评论(0) 推荐(0) 编辑

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 43 下一页

导航