Test cases don't consider the duplication in candidates


  • 1
    S

    It seems that the test cases don't consider the duplication in candidates. For example, candidates=[2,2,3,6,7] and target=7, then the expected answer from Leetcode is [[2,2,3],[2,2,3],[2,2,3],[7]].

    Of course, since elements can be used repeatedly, we can argue that no duplicates exist in the candidate array. But it's better to make it more clearly.


  • 1

    Well we're "Given a set", and sets don't have duplicates.


Log in to reply
 

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