摘要: Given a linked list, swap every two adjacent nodes and return its head. 阅读全文
posted @ 2017-05-07 22:50 JeffLai 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 阅读全文
posted @ 2017-05-07 22:37 JeffLai 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 阅读全文
posted @ 2017-05-07 22:14 JeffLai 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2017-05-07 21:19 JeffLai 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. 阅读全文
posted @ 2017-05-07 21:09 JeffLai 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove the nth node from the end of list and return its head. 阅读全文
posted @ 2017-05-07 20:26 JeffLai 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 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 which gives the sum of target. Note: The solution set must not contain duplicate quadruplets. 阅读全文
posted @ 2017-05-07 20:05 JeffLai 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2017-05-07 19:29 JeffLai 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 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 exactly one solution. 阅读全文
posted @ 2017-05-07 16:51 JeffLai 阅读(141) 评论(0) 推荐(1) 编辑
摘要: 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. 阅读全文
posted @ 2017-05-07 16:34 JeffLai 阅读(112) 评论(0) 推荐(0) 编辑