added implementation for PassingCars and Distinct