Skip to content

Commit 3b05433

Browse files
authored
Update count-number-of-rectangles-containing-each-point.cpp
1 parent b804953 commit 3b05433

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

C++/count-number-of-rectangles-containing-each-point.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
class Solution {
66
public:
77
vector<int> countRectangles(vector<vector<int>>& rectangles, vector<vector<int>>& points) {
8-
int max_y = (*max_element(cbegin(rectangles), cend(rectangles),
9-
[](const auto& a, const auto& b) {
10-
return a[1] < b[1];
11-
}))[1];
8+
const auto max_y = (*max_element(cbegin(rectangles), cend(rectangles),
9+
[](const auto& a, const auto& b) {
10+
return a[1] < b[1];
11+
}))[1];
1212
vector<vector<int>> buckets(max_y + 1);
1313
for (const auto& rec : rectangles) {
1414
buckets[rec[1]].emplace_back(rec[0]);

0 commit comments

Comments
 (0)