Multiset Sum
Given a list of unique positive integers nums and a positive integer k, return the number of unique combinations that sum up to k. You may reuse numbers when creating combinations.
Constraints
n ≤ 25wherenis the length ofnums1 ≤ nums[i] ≤ 250for all0 ≤ i < n1 ≤ k ≤ 500
https://binarysearch.com/problems/Multiset-Sum
Examples
Example 1
Input
- nums =
[1, 2, 3] - k =
2
Output
- answer =
2
Explanation
We can make 2 with [1, 1] and [2].
Leave a comment