Solved (kinda) string similarity problem

Right answer but having optimization problems again. Going to try and
run a python solution to see if better luck and then optimize the ruby
version for this and the last submission as well.