add problem 9 solution in ruby
add js solution to problem 3