#C12858. Combination Sum II
Combination Sum II
Combination Sum II
You are given a list of positive integers and a target integer \(T\). Your task is to find all unique combinations of numbers in the list that sum up exactly to \(T\). Each number in the list may only be used once in each combination, and the numbers within each combination must be in non-decreasing order.
If no valid combination exists, output an empty list.
Note: The input list may contain duplicate numbers, but the solution set must not contain duplicate combinations.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains space-separated positive integers representing the list of numbers.
- The second line contains a single integer representing the target sum \(T\).
outputFormat
The output should be printed to standard output (stdout) as a list of lists in Python-style format. Each inner list represents a unique combination of numbers that add up to the target, with the numbers in non-decreasing order.
## sample2 3 6 7
7
[[7]]