I can't understand this instance:
["10","0001","111001","1","0"]
3
4
the expected answer is 3.
But I think the answer is 2 ["111001","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"]
10
14
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.