Skip to content

Commit b45c732

Browse files
committed
Runtime: 87 ms (Top 5.05%) | Memory: 15.9 MB (Top 5.33%)
1 parent 726e6d0 commit b45c732

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1+
// Runtime: 87 ms (Top 5.05%) | Memory: 15.9 MB (Top 5.33%)
12
class Solution {
23
public:
34
vector<int> luckyNumbers (vector<vector<int>>& matrix) {
4-
5+
56
unordered_map<int,vector<int>>m;
6-
7+
78
for(int i=0;i<matrix.size();i++){
89
vector<int>temp = matrix[i];
910
for(int j=0;j<temp.size();j++){
1011
m[j].push_back(temp[j]);
1112
}
1213
}
13-
14+
1415
unordered_map<int,int>mp;
1516
for(int i=0;i<matrix.size();i++){
1617
vector<int>helper = matrix[i];
17-
18+
1819
sort(helper.begin(),helper.end());
19-
20+
2021
mp[helper[0]]++;
2122
}
2223
vector<int>result;
@@ -30,4 +31,4 @@ class Solution {
3031
}
3132
return result;
3233
}
33-
};
34+
};

0 commit comments

Comments
 (0)