PHP and Javascript solutions to hard challenge #151 - Cracking eggs (Minimization of Maximum Regret)