Skip to content

Commit

Permalink
Update the-skyline-problem.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 committed Jun 11, 2015
1 parent c69a774 commit 6bae284
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions C++/the-skyline-problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class Solution {
}
}

if (height_to_count.empty() || curr_max != height_to_count.crbegin()->first) {
curr_max = height_to_count.empty() ? 0 : height_to_count.crbegin()->first;
if (height_to_count.empty() ||
curr_max != height_to_count.crbegin()->first) {
curr_max = height_to_count.empty() ?
0 : height_to_count.crbegin()->first;
res.emplace_back(point, curr_max);
}
}
Expand Down

0 comments on commit 6bae284

Please sign in to comment.