Create substrings.rb

Solved for single and multiple words.