Algorithms/ACM puzzle solutions written in JavaScript