Codility Challenge: FrogJmp