Codility - Lesson 1: solution to FrogJmp in PHP (Test score: 100%)