Codility - Lesson 3: solution to PassingCars in PHP (Test score: 100%)