I can't understand this instance

  • 0

    I can't understand this instance:


    the expected answer is 3.
    But I think the answer is 2 ["111001","0"].

  • 0

    This question could be clear to mention this: you can use one string multiple times, but has to use as many unique strings as possible.

    Try this test case in your console:

    ["10", "0", "1"]

    Expected result is: 3

    means you can use each element in ["10", "0", "1"] at least once, to get m=2, n=2, then for remaining 0s and 1s, use what ever you want from the array, but in total only 3 distinct string are used.

  • 0

    Thanks, I get it.
    At the first time, I treated this problem as a two dimension subset sum problem, and i think each string can be used only once.

Log in to reply

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