动态规划问题Given an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange...
分类:
其他好文 时间:
2015-12-07 17:52:13
阅读次数:
130
题目来源https://leetcode.com/problems/combination-sum/Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere ...
分类:
编程语言 时间:
2015-12-07 14:13:02
阅读次数:
189
题目: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 ...
分类:
其他好文 时间:
2015-12-07 14:07:07
阅读次数:
209
题目来源https://leetcode.com/problems/combination-sum-ii/Given a collection of candidate numbers (C) and a target number (T), find all unique combinations...
分类:
编程语言 时间:
2015-12-07 14:00:38
阅读次数:
152
此题目摘自LeetCode001Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indic...
分类:
其他好文 时间:
2015-12-06 22:51:14
阅读次数:
334
https://leetcode.com/problems/edit-distance/Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each oper...
分类:
其他好文 时间:
2015-12-06 19:24:36
阅读次数:
200
动态背包题意:给定一系列的硬币值, 然后给定一个目标value, 从所有硬币中找出几个, 使得这几个硬币的和正好等于这个value, 而且这个硬币序列应该是满足硬币值字典序的最小序列.分析:属于典型的背包问题. 用动态规划(dp)做, 假设F(N, M)表示不超过面值M, 而且从前面N个硬币中挑选硬...
分类:
其他好文 时间:
2015-12-06 12:54:37
阅读次数:
209
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which cou...
分类:
其他好文 时间:
2015-12-06 11:28:02
阅读次数:
156
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexi...
分类:
其他好文 时间:
2015-12-06 09:58:13
阅读次数:
192
Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime co...
分类:
其他好文 时间:
2015-12-06 09:55:12
阅读次数:
136