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.
2 parents e502bf3 + 56d2637 commit 151ef34Copy full SHA for 151ef34
2901. Longest Unequal Adjacent Groups Subsequence II1
@@ -0,0 +1,29 @@
1
+class Solution {
2
+public:
3
+ void setZeroes(vector<vector<int>>& matrix) {
4
+ vector<int> iV;
5
+ vector<int> jV;
6
+ int n = matrix.size();
7
+ int m = matrix[0].size();
8
+ for(int i=0;i<n;i++){
9
+ for(int j=0;j<m;j++){
10
+ if(matrix[i][j]==0){
11
+ iV.push_back(i);
12
+ jV.push_back(j);
13
+ }
14
15
16
+
17
+ for(int i=0;i<iV.size();i++){
18
19
+ matrix[iV[i]][j]=0;
20
21
22
23
+ for(int j=0;j<jV.size();j++){
24
25
+ matrix[i][jV[j]]=0;
26
27
28
29
+};
0 commit comments