Switch inject to the shorthand form
Update reworked version of Problem2.rb