上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页
摘要: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, 阅读全文
posted @ 2017-01-07 08:13 lettuan 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
posted @ 2017-01-07 00:00 lettuan 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
posted @ 2017-01-06 14:40 lettuan 阅读(102) 评论(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 whic 阅读全文
posted @ 2017-01-06 10:30 lettuan 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + 阅读全文
posted @ 2017-01-06 04:34 lettuan 阅读(178) 评论(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-01-06 04:04 lettuan 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2017-01-06 03:57 lettuan 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 可以想象有一个无限大的水罐,如果我们有两个杯子x和y,那么原来的问题等价于是否可以通过往里面注入或倒出水从而剩下z。 z =? m*x + n*y 如果等式成立,那么z%gcd(x,y) == 0。 阅读全文
posted @ 2017-01-05 14:00 lettuan 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Numbers can be regarded as product of its factors. For example, Write a function that takes an integer n and return all possible combinations of its f 阅读全文
posted @ 2017-01-05 11:52 lettuan 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. 阅读全文
posted @ 2017-01-05 05:13 lettuan 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页