Reimplemented PHP solution to problem 1 in constant time.
Merge pull request #6 from chessmasterhong/master

Reimplementation of PHP solution to problem 1.