= [2,5,2,1,2], target = 5,
A solution set is:
[
[1,2,2],
[5]
]
Solution
var results [][]int
var existed...int {
results = make([][]int, 0)
if len(candidates) == 0 {
return results
}
existed...var s string = ""
for _, val := range cr {
s += "," + string(val)
}
if _,ok := existed...[s];ok {
return
}
results = append(results, cr)
existed[s] = 1
}
Note:
almost same