Create p001.rb

Ruby implementation of a better approach than the brute force solution in p001.py.