We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a0afee commit f0b7f00Copy full SHA for f0b7f00
maximal_square.cpp
@@ -40,4 +40,21 @@ class Solution {
40
return globalMax * globalMax;
41
//return 0;
42
}
43
-};
+};
44
+
45
46
+/*
47
+if(matrix.size()==0 || matrix[0].size()==0)return 0;
48
+ int maxi=0,n=matrix.size(),m=matrix[0].size();
49
+ vector<vector<int> > dp(n,vector<int>(m,0));
50
+ for(int i=0;i<n;i++){
51
+ for(int j=0;j<m;j++){
52
+ if(i==0 || j==0)dp[i][j]=matrix[i][j]-'0';
53
+ else{
54
+ if(matrix[i][j]=='1')dp[i][j]=1+min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]));
55
+ }
56
+ maxi=max(maxi,dp[i][j]);
57
58
59
+ return maxi*maxi;
60
+*/
0 commit comments