Algorithm · Google · Easy
A highway is equipped with several toll checkpoints. Each time a vehicle passes a checkpoint, the system logs the vehicle's license plate and the checkpoint's identifier. The cost to travel between any two checkpoints is computed as the absolute difference of their numeric positions multiplied by 10, ignoring any non-digit characters. For instance, moving from checkpoint "A1" to "A5" costs 1 - 5 * 10 = 40. At the end of the day, you need to compute the total toll for each…
Checking your access…