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/jump_game6.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 other/jump_game6.cpp (limited to 'other/jump_game6.cpp') diff --git a/other/jump_game6.cpp b/other/jump_game6.cpp deleted file mode 100644 index 81bbf05..0000000 --- a/other/jump_game6.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int maxResult(vector &nums, int k) { - int ans = 0; - deque dq; - for (int i = nums.size() - 1; i >= 0; i--) { - ans = nums[i] + (dq.empty() ? 0 : nums[dq.front()]); - while (!dq.empty() && ans > nums[dq.back()]) - dq.pop_back(); - dq.push_back(i); - if (dq.front() >= i + k) - dq.pop_front(); - nums[i] = ans; - } - return ans; - } -}; - -int main() { - Solution obj; - vector nums = {1, -1, -2, 4, -7, 3}; - int k = 2; - cout << obj.maxResult(nums, k); -} -- cgit v1.2.3