From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/skyline_problem.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 other/skyline_problem.cpp (limited to 'other/skyline_problem.cpp') diff --git a/other/skyline_problem.cpp b/other/skyline_problem.cpp deleted file mode 100644 index b19c87a..0000000 --- a/other/skyline_problem.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - vvd getSkyline(vvd & buildings) { - vvd ans; - map>> mvp; - for (auto &b : buildings) { - mvp[b[0]].push_back({b[2], 0}); - mvp[b[1]].push_back({b[2], 1}); - } - multiset m; - for (auto &[pos, heights] : mvp) { - for (auto &[height, type] : heights) { - if (type == 0) - m.insert(height); - else - m.erase(m.find(height)); - } - int newHeight = m.empty() ? 0 : *m.begin(); - if (!ans.empty() && ans.back()[1] == newHeight) - continue; - else - ans.push_back(vector({pos, newHeight})); - } - return ans; - } -}; -- cgit v1.2.3