aboutsummaryrefslogtreecommitdiff
path: root/other/min_num_refueling_stops.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
committerJack Sangdahl <[email protected]>2025-06-27 12:23:02 -0600
commita96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch)
treee2a2b3f49f9fb741be81415266ac93e74cff42ec /other/min_num_refueling_stops.cpp
parent694ad5ed71edcb1deccab54b72d706b779918276 (diff)
downloadleetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz
leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/min_num_refueling_stops.cpp')
-rw-r--r--other/min_num_refueling_stops.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/other/min_num_refueling_stops.cpp b/other/min_num_refueling_stops.cpp
deleted file mode 100644
index 34d929b..0000000
--- a/other/min_num_refueling_stops.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- int minRefuelStops(int target, int startFuel, vector<vector<int>> &stations) {
- int n = stations.size(), ans = 0;
- priority_queue<int> pq;
- for (int i = 0; i <= n; i++) {
- int dist = i == n ? target : stations[i][0];
- while (startFuel < dist) {
- if (!pq.size())
- return -1;
- startFuel += pq.top();
- ans++;
- pq.pop();
- }
- if (i < n)
- pq.push(stations[i][1]);
- }
- return ans;
- }
-};