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/gas_station.rs | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 other/gas_station.rs (limited to 'other/gas_station.rs') diff --git a/other/gas_station.rs b/other/gas_station.rs deleted file mode 100644 index 0554f5b..0000000 --- a/other/gas_station.rs +++ /dev/null @@ -1,26 +0,0 @@ -struct Solution; - -impl Solution { - pub fn can_complete_circuit(gas: Vec, cost: Vec) -> i32 { - let (mut sum, mut idx, mut min) = (0, 0, 0); - for i in 0..gas.len() { - sum += gas[i] - cost[i]; - if sum < min { - min = sum; - idx = i + 1; - } - } - if sum < 0 { - -1 - } else { - idx as i32 - } - } -} - -fn main() { - let (gas1, gas2) = (vec![1,2,3,4,5], vec![2,3,4]); - let (cost1, cost2) = (vec![3,4,5,1,2], vec![3,4,3]); - println!("{}", Solution::can_complete_circuit(gas1, cost1)); //expect: 3 - println!("{}", Solution::can_complete_circuit(gas2, cost2)); //expect: -1 -} -- cgit v1.2.3