Solutions to algorithm challenges in JavaScript.