Javascript solutions to problems in Algorithms 1 from Coursera