Skip to content

Commit 86dd5b6

Browse files
committed
Time: 0 ms (100.00%) | Memory: 64.6 MB (89.53%) - LeetSync
1 parent be714aa commit 86dd5b6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Solution {
2+
public:
3+
vector<int> rowAndMaximumOnes(vector<vector<int>>& mat) {
4+
int max = 0;
5+
int row = 0;
6+
for(int i = 0;i<mat.size();i++){
7+
int count = 0;
8+
for(int j = 0;j<mat[0].size();j++){
9+
if(mat[i][j] == 1)
10+
count ++;
11+
}
12+
if(count>max){
13+
max = count ;
14+
row = i;
15+
}
16+
}
17+
return {row , max};
18+
}
19+
};

0 commit comments

Comments
 (0)