Citadel Interview Question

Finding the minimum of two train distances.