Answers to Codility Tests in PHP