solution_18.rb, #35