Welcome back.
Previously we have solved combination sum one.
Now over here, let's get started with another interesting question which is combination sum two.
So the question reads given a collection of candidate numbers candidates and a target number target,
find all unique combinations in candidates where the candidate numbers sum to target.
Each number in candidates may only be used once in the combination.
Note the solution set must not contain duplicate combinations.
So over here we are given an example as well.
So let's say the input is 35213 and the target number which is given to us is seven.
Then the output is an array of arrays.
And over here each element in this array over here has elements inside it with sum up to the target
value.
So one plus three plus three seven and five plus two is seven.
Now again notice in this question it says that each number may only be used once.
So for example over here you have five and two.
And over here you have one three and three.
But this is not a violation because you are given two threes in the input array.
And we're just using every element in the input array one time.
So this is the question.
Now notice also that it's mentioned over here that the output array must not contain duplicates.
So what would that mean.
Let's say for the sake of our discussion, if the target value was four instead of seven, then if one
element in the output array is three comma one.
Taking this three and this one and another element is one comma three taking this one and this three,
then these two would be duplicates.
And it's mentioned in the question that the solution set must not contain duplicate combinations.
So this is the question.
Now in the next video let's try to think about how we can solve this.
And let's also compare this with combination sum one so that we can understand the differences between
these two questions and how the approach has to be slightly tweaked to solve this question.