← 返回 tesla 的题目列表API to Calculate Final Car Position
类型:online_judge
Design an API to calculate the final position of a car after a series of operations. Each operation could be accelerate, stop, or change direction. Calculate the shortest sequence of operations required to reach the target position. The input includes the initial position, target position, and a series of operations. The output is the car's final position after all operations.
Example
Input
0 10 ['accelerate', 'stop', 'change direction']