Skip to main content
  1. Posts/

leetcode 40. Combination Sum II (枚举子集,和为定值)

·1 min
Note: This article is available in Chinese only. 本文暂无英文版本。 View original
  * Total Accepted: **106670**
  * Total Submissions: **329718**
  * Difficulty: **Medium**
  * Contributor: **LeetCode**

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.

Each number in C may only be used once in the combination.

Note:

  * All numbers (including target) will be positive integers.
  * The solution set must not contain duplicate combinations.

题意:若干正数,求所有和为target的组合。

思路:枚举子集,用和剪枝。

Related

leetcode 495. Teemo Attacking

·1 min
In LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo’s attacking ascending time series towards Ashe and the poisoning time duration per Teemo’s attacking, you need to output the total time that Ashe is in poisoned condition.