Add ruby for problem 8

each_with_index and reduce together is a little confusing, maybe
borderline too clever territory (especially with the ternary)?
In any case as it is now its preferable to initalizing and extra
variable and returning it.