Self-driving cars are electric and are able to drive around the city autonomously before they need to go back to the garage to charge. An important metric is how long a car can drive before it needs to recharge.
Self-driving cars are electric and are able to drive around the city autonomously before they need to go back to the garage to charge. An important metric is how long a car can drive before it needs to recharge.
In this problem, we have received battery usage logs from a single car
Find-
1) the total time the car was in autonomous mode, as well as
2) the hourly average drain in battery while the car was in autonomous mode.
The dataset is represented in rows separated by newline characters, where each row contains timestamp, battery_percentage, and mode (all space separated).
1 10 autonomous
2 20 manual
3 20 autonomous
Pretty strainght forward question - scan the list and store the count.