mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-02-27 11:58:39 +08:00
routine
This commit is contained in:
15
26/01/1895.cpp
Normal file
15
26/01/1895.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <vector>
|
||||
|
||||
class Solution {
|
||||
public:
|
||||
int largestMagicSquare(std::vector<std::vector<int>>& grid) {
|
||||
int m = grid.size();
|
||||
int n = grid[0].size();
|
||||
std::vector<std::vector<int>> preM(m,std::vector<int>(n,0)),preN(m,std::vector<int>(n,0));
|
||||
for (int i = 0; i < m; i++) {
|
||||
for(int j = 0;j < n;j++){
|
||||
preM[m][n] += grid[m][n];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user