Add js solution to problem 1