Solutions for MaxCounters and PassingCars tasks