Any tractable solution?


  • 0
    W

    i only saw intractable solutions for this problem: for a collection with a large cardinality, those solutions are null.


  • 2
    R

    You can solve this by reducing to Combination Sum. Since we only can choose a certain element once in num(but this element might have duplicates in num), so we can view this as doing Combination Sum with constraint that for every element we can only choose it for certain amount of times(comparing to original question which allows unlimited amount of times)


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.