@@ -0,0 +1,1056 @@
+public class Solution %7B%0A    /**%0A     * @param strs: an array with strings include only 0 and 1%0A     * @param m: An integer%0A     * @param n: An integer%0A     * @return: find the maximum number of strings%0A     */%0A    public int findMaxForm(String%5B%5D strs, int m, int n) %7B%0A        int%5B%5D%5B%5D%5B%5D dp = new int%5Bstrs.length + 1%5D%5Bm + 1%5D%5Bn + 1%5D;%0A        for (int i = 1; i %3C= strs.length; i++) %7B%0A            int%5B%5D cost = count(strs%5Bi - 1%5D);%0A            for (int j = 0; j %3C= m; j++) %7B%0A                for (int k = 0; k %3C= n; k++) %7B%0A                    if (j %3E= cost%5B0%5D && k %3E= cost%5B1%5D) %7B%0A                        dp%5Bi%5D%5Bj%5D%5Bk%5D = Math.max(dp%5Bi - 1%5D%5Bj%5D%5Bk%5D, dp%5Bi - 1%5D%5Bj - cost%5B0%5D%5D%5Bk - cost%5B1%5D%5D + 1);%0A                    %7D else %7B%0A                        dp%5Bi%5D%5Bj%5D%5Bk%5D = dp%5Bi - 1%5D%5Bj%5D%5Bk%5D;%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        return dp%5Bstrs.length%5D%5Bm%5D%5Bn%5D;%0A    %7D%0A%0A    public int%5B%5D count(String str) %7B%0A        int%5B%5D cost = new int%5B2%5D;%0A        for (int i = 0; i %3C str.length(); i++)%0A            cost%5Bstr.charAt(i) - '0'%5D++;%0A        return cost;%0A    %7D%0A%7D

add 668