Re:Proof You Can Become a Better Programmer
by CydeWeys on Sunday November 27, 2016 @11:16AM
(#13049869)
I've never done Ruby, but what I don't like about that second solution is how much logic it puts into formatting directives in a string literal:
> "#{x}#{input.split('').count(x)}"
Just because Ruby apparently allows you to do that much in a formatting directive doesn't mean you should.
The first problem has a clear improvement.
I just checked ruby doc and 'reduce' and 'inject' seem to be synonyms, as far as I can tell.