How do I make sure no repetition in answer

The logic is correct, I am getting all possible answers including the condition that element is to be used to once. However, if there is repetition in the array itself, then few answers will be repeated. How do i manage this. Example, As there is two ‘1’ in the input, all the answers starting with 1 are repeated.