diff options
author | Jack Sangdahl <[email protected]> | 2025-02-03 15:37:19 -0700 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-02-03 15:37:19 -0700 |
commit | 55a67f776dd9acd258cae16ffb636751666b0f40 (patch) | |
tree | 601539de43809b70ceb8228a12c35883fa300b03 /last_stone_weight.cpp | |
parent | a0030873dabb517594ae0394350d6715071f7fb8 (diff) | |
download | leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.tar.gz leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.zip |
chore: Remove incomplete solutions
Diffstat (limited to 'last_stone_weight.cpp')
-rw-r--r-- | last_stone_weight.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/last_stone_weight.cpp b/last_stone_weight.cpp deleted file mode 100644 index c7422db..0000000 --- a/last_stone_weight.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int lastStoneWeight(vector<int> &stones) { - make_heap(stones.begin(), stones.end()); - while (stones.size() > 1) { - int x = stones.front(); - pop_heap(stones.begin(), stones.end()); - stones.pop_back(); - int y = stones.front(); - pop_heap(stones.begin(), stones.end()); - stones.pop_back(); - if (x == y) - continue; - stones.push_back(x - y); - push_heap(stones.begin(), stones.end()); - } - return stones.size() ? stones.front() : 0; - } -}; - -int main() {} |