Add #49 JavaScript solution