The problem with this problem

  • 0

    It's explicitly required in the original problem, that no duplicated combinations are allowed. However, the expected answer itself allows duplicated combinations! Try out this test case:

    The expected answer will be:

    You can see many duplicated combinations in the final expected answer.

  • 2

    The input is supposed to be a set, and by definition there shouldn't be any duplicates in a set. Your input contains two "2"s so it's not a valid input. You can argue though that the program then should expect an input set instead of an array or do a conversion first but I don't think they bothered with it.

Log in to reply

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