PHP and Javascript solutions to hard challenge #85 - Find Min (Facebook Hacker Cup 2013 Hackathon)