@@ -0,0 +1,860 @@
+package leetcode.maximal_square;%0A%0Apublic class Solution %7B%0A    public int maximalSquare(char%5B%5D%5B%5D matrix) %7B%0A        if(matrix.length == 0 %7C%7C matrix%5B0%5D.length == 0) return 0;%0A        int h = matrix.length, w = matrix%5B0%5D.length;%0A        int%5B%5D%5B%5D maxSqrSize = new int%5Bh%5D%5Bw%5D;%0A        int max = 0;%0A        for(int i = 0; i %3C h; i++)%7B%0A            for(int j = 0; j %3C w; j++)%7B%0A                if(matrix%5Bi%5D%5Bj%5D == '1')%7B%0A                    int m = 1;%0A                    if(i %3E 0 && j %3E 0)%7B%0A                        m = Math.min(maxSqrSize%5Bi - 1%5D%5Bj%5D, maxSqrSize%5Bi%5D%5Bj - 1%5D);%0A                        if(matrix%5Bi - m%5D%5Bj - m%5D == '1')%7B%0A                            m++;%0A                        %7D%0A                    %7D%0A                    maxSqrSize%5Bi%5D%5Bj%5D = m;%0A                    max = Math.max(m, max);%0A                %7D%0A            %7D%0A        %7D%0A        return max * max;%0A    %7D%0A%7D%0A

Add java solution for 221. Maximal Square