I've come up with this DP solution:

```
int findMaxForm(vector<string>& strs, int m, int n) {
vector<vector<int>> dp(n + 1, vector<int>(m + 1, -1));
dp[0][0] = 0;
for(int k = 0; k < strs.size(); k++) {
int ones = 0, zeros = 0;
for(int i = 0; i < (int)strs[k].length(); i++) {
ones += (strs[k][i] == '1');
zeros += (strs[k][i] == '0');
}
for(int i = n; i >= ones; i--) {
for(int j = m; j >= zeros; j--) {
if(dp[i - ones][j - zeros] >= 0) {
dp[i][j] = max(dp[i][j], dp[i - ones][j - zeros] + 1);
}
}
}
}
return max(dp[n][m], 0);
}
```

But I got wrong answer in this test-case:

```
["10","0001","111001","1","0"]
3
4
```

How the output is `3`

?

In my understanding, output should be `2`

(`"111001","0"`

).

Then I modified my solution this way which is supposed to be wrong I guess and got accepted:

```
int findMaxForm(vector<string>& strs, int m, int n) {
vector<vector<int>> dp(n + 1, vector<int>(m + 1, 0));
for(int k = 0; k < strs.size(); k++) {
int ones = 0, zeros = 0;
for(int i = 0; i < (int)strs[k].length(); i++) {
ones += (strs[k][i] == '1');
zeros += (strs[k][i] == '0');
}
for(int i = n; i >= ones; i--) {
for(int j = m; j >= zeros; j--) {
dp[i][j] = max(dp[i][j], dp[i - ones][j - zeros] + 1);
}
}
}
return dp[n][m];
}
```

Now I am thinking test-cases for this problem are wrong. Can anyone please take a look?