Countdown numbers game solver written in JavaScript