摘要: ou are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concat 阅读全文
posted @ 2017-07-05 17:47 apanda009 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here ak-diff pair is defined as an integ 阅读全文
posted @ 2017-07-05 15:23 apanda009 阅读(151) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/#/solutions Given a string and a string dictionary, find the longest string 阅读全文
posted @ 2017-07-05 14:38 apanda009 阅读(169) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/reverse-vowels-of-a-string/#/description http://www.cnblogs.com/EdwardLiu/p/6096319.html 阅读全文
posted @ 2017-07-05 13:44 apanda009 阅读(131) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/trapping-rain-water/#/solutions Fb: O(1)space 这种方法是基于动态规划的,基本思路就是维护一个长度为n的数组,进行两次扫描,一次从左往右,一次从右往左。第一次扫描的时候维护对于每一个bar左边最大 阅读全文
posted @ 2017-07-04 12:09 apanda009 阅读(155) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/partition-list/#/description http://www.cnblogs.com/EdwardLiu/p/3807137.html Given a linked list and a value x, partitio 阅读全文
posted @ 2017-07-03 17:38 apanda009 阅读(129) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/remove-element/#/description Given an array and a value, remove all instances of that value in place and return the new 阅读全文
posted @ 2017-07-01 19:03 apanda009 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problemset/all/?search=19 涉及链表删除操作的时候,稳妥起见都用 dummynode,省去很多麻烦。因为不一定什么时候 head 就被删了。 快慢指针 阅读全文
posted @ 2017-07-01 18:36 apanda009 阅读(127) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/4sum/#/solutions Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target 阅读全文
posted @ 2017-07-01 18:05 apanda009 阅读(127) 评论(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. 阅读全文
posted @ 2017-07-01 16:49 apanda009 阅读(139) 评论(0) 推荐(0) 编辑