Car Fueling Problem by Greedy Alogorithm (getting list index out of range)
问题 I have a small problem solving the Car fueling problem using the Greedy Algorithm. Problem Introduction You are going to travel to another city that is located 𝑑 miles away from your home city. Your car can travel at most 𝑚 miles on a full tank and you start with a full tank. Along your way, there are gas stations at distances stop1 stop2 . . . ,stopN from your home city. What is the minimum number of refills needed? Input: 950 400 4 200 375 550 750 Output: 2 What I've tried as of now def car