给定一个数组和一个目标值,计算得出目标值的所有组合,重复值将出现在组合中,每个重复值在每个组合中只能出现一次。
[En]
Given an array and a target value, calculate all combinations that sum up to the target value, and duplicate values will appear in the combination, and each duplicate value can only appear once in each combination.
包含小数。
```java;gutter:true;
import java.util.*;
public class Match {
public static void main(String[] args) {
Double[] nums = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 5.5, 0.5, 0.5, 0.4};
List nlist = Arrays.asList(nums);
Double target = 8.0;
List> result = sum(nlist, target, null);
for (List doubles : result) {
System.out.println(Arrays.toString(new List[]{doubles}));
}
}